mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-05-22 05:12:48 +12:00
Clean up whitespace before calculating reading ease
This commit is contained in:
parent
1c8ab8a3e1
commit
aa55c36473
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "fimfic2epub",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"description": "Tool to generate improved EPUB ebooks from Fimfiction stories",
|
||||
"author": "djazz",
|
||||
"repository": {
|
||||
|
|
|
@ -388,7 +388,9 @@ class FimFic2Epub extends Emitter {
|
|||
ch.realWordCount = utils.htmlWordCount(chapter.content)
|
||||
}
|
||||
if (this.options.calculateReadingEase && !ch.readingEase) {
|
||||
ch.readingEase = utils.readingEase(utils.htmlToText(chapter.content))
|
||||
let text = utils.htmlToText(chapter.content)
|
||||
text = text.replace(/\s+/g, ' ').trim()
|
||||
ch.readingEase = utils.readingEase(text)
|
||||
}
|
||||
this.progress(0, (i + 1) / this.chapters.length, 'Processed chapter ' + (i + 1) + ' / ' + this.chapters.length)
|
||||
}).then(() => new Promise((resolve) => setTimeout(resolve, 20)))
|
||||
|
|
Loading…
Reference in a new issue