Поправки багов

This commit is contained in:
Book Pauk
2019-02-21 21:02:27 +07:00
parent 06cdc6eb63
commit e5384e27e5
2 changed files with 12 additions and 3 deletions

View File

@@ -78,6 +78,10 @@ export default class BookParser {
resolve(); resolve();
}; };
i.onerror = (e) => {
reject(e);
};
i.src = `data:${binaryType};base64,${data}`; i.src = `data:${binaryType};base64,${data}`;
await sleep(30*1000); await sleep(30*1000);
if (!resolved) if (!resolved)
@@ -98,6 +102,10 @@ export default class BookParser {
resolve(); resolve();
}; };
i.onerror = (e) => {
reject(e);
};
i.src = src; i.src = src;
await sleep(30*1000); await sleep(30*1000);
if (!resolved) if (!resolved)
@@ -641,9 +649,9 @@ export default class BookParser {
//изображения //изображения
if (part.image.id && !part.image.inline) { if (part.image.id && !part.image.inline) {
parsed.visible = this.showImages; parsed.visible = this.showImages;
const bin = this.binary[part.image.id]; let bin = this.binary[part.image.id];
if (!bin) if (!bin)
continue; bin = {h: 0, w: 0};
let lineCount = this.imageHeightLines; let lineCount = this.imageHeightLines;
const c = Math.ceil(bin.h/this.lineHeight); const c = Math.ceil(bin.h/this.lineHeight);
@@ -670,6 +678,7 @@ export default class BookParser {
line.last = true; line.last = true;
line.parts.push({style, text: ' ', line.parts.push({style, text: ' ',
image: {local: part.image.local, inline: false, id: part.image.id, imageLine: i, lineCount, paraIndex}}); image: {local: part.image.local, inline: false, id: part.image.id, imageLine: i, lineCount, paraIndex}});
continue; continue;
} }

View File

@@ -271,7 +271,7 @@ class BookConverter {
path += '/' + elemName; path += '/' + elemName;
tag = elemName; tag = elemName;
} else { } else {
if (inPara && elemName != 'i' && elemName != 'b' && elemName != 'img') if (inPara && elemName != 'i' && elemName != 'b' && elemName != 'em' && elemName != 'strong' && elemName != 'img')
closeTag('p'); closeTag('p');
switch (elemName) { switch (elemName) {