Woopread: Remove links
This commit is contained in:
@@ -139,8 +139,10 @@ const chapterScraper = async (req, res) => {
|
|||||||
|
|
||||||
const chapterName = $("h1#chapter-heading").text();
|
const chapterName = $("h1#chapter-heading").text();
|
||||||
let chapterText = $(".reading-content").html();
|
let chapterText = $(".reading-content").html();
|
||||||
chapterText = parseHtml(chapterText);
|
chapterText = parseHtml(chapterText).replace(
|
||||||
chapterText = chapterText.replace(/(?<=[[])[\n](?=[h])/g, "");
|
/\[(https:\/\/docs.google.com\/)(.*?)\]/g,
|
||||||
|
""
|
||||||
|
);
|
||||||
|
|
||||||
let nextChapter = null;
|
let nextChapter = null;
|
||||||
|
|
||||||
|
|||||||
+1
-5
@@ -28,11 +28,7 @@ const scraper = async (url) => {
|
|||||||
|
|
||||||
const parseHtml = (html) => {
|
const parseHtml = (html) => {
|
||||||
let text = htmlToText(html);
|
let text = htmlToText(html);
|
||||||
text = text.replace(
|
text = text.replace(/\n{2,}/g, "\n\n");
|
||||||
/(?<=[ A-Za-z0-9_@./#&+-])\n(?=[ A-Za-z0-9_@./#&+-])/g,
|
|
||||||
" "
|
|
||||||
);
|
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user