diff --git a/gulpfile.babel.js b/gulpfile.babel.js index be2b293..2035ea3 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -49,8 +49,12 @@ let webpackDefines = new webpack.DefinePlugin({ FIMFIC2EPUB_VERSION: JSON.stringify(packageVersion) }) +// No need to bloat the build with a list of all tlds... +let replaceTlds = new webpack.NormalModuleReplacementPlugin(/^tlds$/, '../../src/false') + webpackConfig.forEach((c) => { c.plugins.push(webpackDefines) + c.plugins.push(replaceTlds) }) let wpCompiler = webpack(webpackConfig) diff --git a/package.json b/package.json index 986228b..1df7fc9 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "sanitize-filename": "^1.6.0", "syllable": "^3.0.0", "twemoji": "^2.5.0", + "url-regex": "^4.1.1", "zero-fill": "^2.2.3" }, "devDependencies": { diff --git a/src/FimFic2Epub.js b/src/FimFic2Epub.js index 83d22fd..4da8c55 100644 --- a/src/FimFic2Epub.js +++ b/src/FimFic2Epub.js @@ -222,6 +222,7 @@ class FimFic2Epub extends EventEmitter { let p = Promise.resolve() let matchChapter = /
[\s\S]*?<\/header>([\s\S]*?)<\/article>/g for (let ma, i = 0; (ma = matchChapter.exec(html)); i++) { + const ch = this.storyInfo.chapters[i] let chapterContent = ma[1] chapterContent = chapterContent.replace(/