diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index e513c4e2..2a58ea01 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -43,6 +43,7 @@ export default class BookParser { let tag = ''; let nextPerc = 0; let center = false; + let bold = false; let paraIndex = -1; let paraOffset = 0; @@ -106,10 +107,16 @@ export default class BookParser { growParagraph(`<${tag}>`, 0); } - if (tag == 'title' || tag == 'subtitle') { + if (tag == 'title') { newParagraph(' ', 1); + bold = true; center = true; } + + if (tag == 'subtitle') { + newParagraph(' ', 1); + bold = true; + } }); parser.on('endNode', (elemName, isTagStart, getStrNode) => {// eslint-disable-line no-unused-vars @@ -118,8 +125,13 @@ export default class BookParser { growParagraph(`${tag}>`, 0); } - if (tag == 'title' || tag == 'subtitle') + if (tag == 'title') { + bold = false; center = false; + } + + if (tag == 'subtitle') + bold = false; path = path.substr(0, path.length - tag.length - 1); let i = path.lastIndexOf('/'); @@ -171,8 +183,10 @@ export default class BookParser { fb2.annotation += text; } - let cOpen = (center ? '