From 7194639a3b5872e1dce34c6f96dce92baab2a670 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 22 Jan 2019 18:01:06 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=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/TextPage/TextPage.vue | 2 +- client/components/Reader/share/BookParser.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 15866ef0..57181690 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -41,7 +41,7 @@ class TextPage extends Vue { fontSize = null; fontName = null; - //meta = null; + meta = null; created() { this.drawHelper = new DrawHelper(); diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index 5f0e035d..bc56aa9d 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -100,10 +100,18 @@ export default class BookParser { if ((tag == 'p' || tag == 'empty-line') && path.indexOf('/FictionBook/body/section') == 0) { newParagraph(' ', 1); } + + if (tag == 'emphasis' || tag == 'strong') { + growParagraph(`<${tag}>`, 0); + } }); parser.on('endNode', (elemName, isTagStart, getStrNode) => {// eslint-disable-line no-unused-vars if (tag == elemName) { + if (tag == 'emphasis' || tag == 'strong') { + growParagraph(``, 0); + } + path = path.substr(0, path.length - tag.length - 1); let i = path.lastIndexOf('/'); if (i >= 0) { @@ -168,7 +176,7 @@ export default class BookParser { newParagraph(text, text.length); break; default: - growParagraph(`<${tag}>${text}`, text.length); + growParagraph(text, text.length); } } });