|
@@ -61,6 +61,11 @@ export default class BookParser {
|
|
|
};
|
|
|
|
|
|
const growParagraph = (text, len) => {
|
|
|
+ if (paraIndex < 0) {
|
|
|
+ newParagraph(text, len);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let p = para[paraIndex];
|
|
|
if (p) {
|
|
|
paraOffset -= p.length;
|
|
@@ -99,13 +104,13 @@ export default class BookParser {
|
|
|
}
|
|
|
|
|
|
if (tag == 'title') {
|
|
|
- newParagraph(' ', 1);
|
|
|
+ //newParagraph(' ', 1);
|
|
|
bold = true;
|
|
|
center = true;
|
|
|
}
|
|
|
|
|
|
if (tag == 'subtitle') {
|
|
|
- newParagraph(' ', 1);
|
|
|
+ //newParagraph(' ', 1);
|
|
|
bold = true;
|
|
|
}
|
|
|
};
|
|
@@ -138,7 +143,6 @@ export default class BookParser {
|
|
|
text = he.decode(text);
|
|
|
text = text.replace(/>/g, '>');
|
|
|
text = text.replace(/</g, '<');
|
|
|
- text = text.replace(/[\t\n\r]/g, ' ');
|
|
|
|
|
|
if (text != ' ' && text.trim() == '')
|
|
|
text = text.trim();
|
|
@@ -146,6 +150,8 @@ export default class BookParser {
|
|
|
if (text == '')
|
|
|
return;
|
|
|
|
|
|
+ text = text.replace(/[\t\n\r]/g, ' ');
|
|
|
+
|
|
|
switch (path) {
|
|
|
case '/fictionbook/description/title-info/author/first-name':
|
|
|
fb2.firstName = text;
|