Поправки багов
This commit is contained in:
@@ -61,6 +61,11 @@ export default class BookParser {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const growParagraph = (text, len) => {
|
const growParagraph = (text, len) => {
|
||||||
|
if (paraIndex < 0) {
|
||||||
|
newParagraph(text, len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let p = para[paraIndex];
|
let p = para[paraIndex];
|
||||||
if (p) {
|
if (p) {
|
||||||
paraOffset -= p.length;
|
paraOffset -= p.length;
|
||||||
@@ -99,13 +104,13 @@ export default class BookParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tag == 'title') {
|
if (tag == 'title') {
|
||||||
newParagraph(' ', 1);
|
//newParagraph(' ', 1);
|
||||||
bold = true;
|
bold = true;
|
||||||
center = true;
|
center = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag == 'subtitle') {
|
if (tag == 'subtitle') {
|
||||||
newParagraph(' ', 1);
|
//newParagraph(' ', 1);
|
||||||
bold = true;
|
bold = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -138,7 +143,6 @@ export default class BookParser {
|
|||||||
text = he.decode(text);
|
text = he.decode(text);
|
||||||
text = text.replace(/>/g, '>');
|
text = text.replace(/>/g, '>');
|
||||||
text = text.replace(/</g, '<');
|
text = text.replace(/</g, '<');
|
||||||
text = text.replace(/[\t\n\r]/g, ' ');
|
|
||||||
|
|
||||||
if (text != ' ' && text.trim() == '')
|
if (text != ' ' && text.trim() == '')
|
||||||
text = text.trim();
|
text = text.trim();
|
||||||
@@ -146,6 +150,8 @@ export default class BookParser {
|
|||||||
if (text == '')
|
if (text == '')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
text = text.replace(/[\t\n\r]/g, ' ');
|
||||||
|
|
||||||
switch (path) {
|
switch (path) {
|
||||||
case '/fictionbook/description/title-info/author/first-name':
|
case '/fictionbook/description/title-info/author/first-name':
|
||||||
fb2.firstName = text;
|
fb2.firstName = text;
|
||||||
|
|||||||
Reference in New Issue
Block a user