From f74f44822e25f5dcd94587520725153b08e62119 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sat, 2 Feb 2019 18:15:45 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B1=D0=B0=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/share/BookParser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index e7d0449b..5dfe1c82 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -206,6 +206,7 @@ export default class BookParser { this.fb2 = fb2; this.para = para; + this.textLength = paraOffset; callback(100); @@ -465,7 +466,7 @@ export default class BookParser { } } - line.end = para.offset + ofs - wordTail.length - 1; + line.end = para.offset + ofs - wordTail.length - 1 - (i < words.length - 1 ? 1 : 0); if (line.end - line.begin < 0) console.error(`Parse error, empty line in paragraph ${paraIndex}`); @@ -547,7 +548,7 @@ export default class BookParser { } getLines(bookPos, n) { - const result = []; + let result = []; let paraIndex = this.findParaIndex(bookPos); if (paraIndex === undefined)