From 83a60b4091cf28ec53c8582832d14c2723aae4c1 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 13 Nov 2020 23:59:55 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BF=D0=B0=D1=80=D1=81=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/share/BookParser.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index 19d3d996..328f927e 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -189,7 +189,7 @@ export default class BookParser { return; tag = elemName; - path += '/' + elemName; + path += '/' + tag; if (tag == 'binary') { let attrs = sax.getAttrsSync(tail); @@ -216,7 +216,7 @@ export default class BookParser { } } - if (elemName == 'author' && path.indexOf('/fictionbook/description/title-info/author') == 0) { + if (tag == 'author' && path.indexOf('/fictionbook/description/title-info/author') == 0) { if (!fb2.author) fb2.author = []; fb2.author.push({}); @@ -272,7 +272,7 @@ export default class BookParser { curTitle.subtitles.push(curSubtitle); } - if (tag == 'epigraph') { + if (tag == 'epigraph' || tag == 'annotation') { italic = true; space += 1; } @@ -321,9 +321,11 @@ export default class BookParser { inSubtitle = false; } - if (tag == 'epigraph') { + if (tag == 'epigraph' || tag == 'annotation') { italic = false; space -= 1; + if (tag == 'annotation') + newParagraph(' ', 1); } if (tag == 'stanza') {