preserve line breaks in WuxiaWorld

This commit is contained in:
Rajarshee Chatterjee
2021-05-03 17:16:42 +05:30
parent 8c8881cef2
commit 851a62eacf
+5 -1
View File
@@ -113,7 +113,11 @@ const chapterScraper = async (req, res) => {
let chapterName = $("#sidebar-toggler-container").next().text();
chapterName = chapterName.replace(/[\t\n]/g, "");
const chapterText = $("#chapter-content").text();
$("#chapter-content > script").remove();
const chapterText = $("#chapter-content")
.html()
.replace(/<(?:.|\n)*?>/gm, "\n");
let nextChapter = null;