Мелкие поправки
This commit is contained in:
@@ -138,7 +138,7 @@ export default class BookParser {
|
|||||||
});
|
});
|
||||||
|
|
||||||
parser.on('textNode', (text) => {
|
parser.on('textNode', (text) => {
|
||||||
text = text.replace(/[\t\n\r]/g, ' ');
|
text = text.replace(/ |[\t\n\r]/g, ' ');
|
||||||
|
|
||||||
if (text != ' ' && text.trim() == '')
|
if (text != ' ' && text.trim() == '')
|
||||||
text = text.trim();
|
text = text.trim();
|
||||||
@@ -179,22 +179,22 @@ export default class BookParser {
|
|||||||
fb2.annotation += text;
|
fb2.annotation += text;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cOpen = (center ? '<center>' : '');
|
let tOpen = (center ? '<center>' : '');
|
||||||
cOpen += (bold ? '<strong>' : '');
|
tOpen += (bold ? '<strong>' : '');
|
||||||
let cClose = (center ? '</center>' : '');
|
let tClose = (center ? '</center>' : '');
|
||||||
cClose += (bold ? '</strong>' : '');
|
tClose += (bold ? '</strong>' : '');
|
||||||
|
|
||||||
if (path.indexOf('/FictionBook/body/title') == 0) {
|
if (path.indexOf('/FictionBook/body/title') == 0) {
|
||||||
newParagraph(`${cOpen}${text}${cClose}`, text.length, true);
|
newParagraph(`${tOpen}${text}${tClose}`, text.length, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path.indexOf('/FictionBook/body/section') == 0) {
|
if (path.indexOf('/FictionBook/body/section') == 0) {
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 'p':
|
case 'p':
|
||||||
growParagraph(`${cOpen}${text}${cClose}`, text.length);
|
growParagraph(`${tOpen}${text}${tClose}`, text.length);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
growParagraph(`${cOpen}${text}${cClose}`, text.length);
|
growParagraph(`${tOpen}${text}${tClose}`, text.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user