FWN: better regex + another case (#1207)

* FWN: better regex + another case

* lint

* forgot last case
This commit is contained in:
Palloxin
2024-12-01 15:05:24 +01:00
committed by GitHub
parent fe87accbc0
commit 256bb18a36
+3 -6
View File
@@ -116,13 +116,10 @@ class FreeWebNovel implements Plugin.PluginBase {
const chapterText = loadedCheerio('div.txt').html() || '';
return chapterText
.replace(
/(?:(?<=<p>\s*)(?:This (?:chapter is updated by|content is taken from)|Follow current novels on) )?[ƒfF][Rrɾг][Eēeё][Eēёe][Wwω][Eёēe][Bbɓ][Nnɳη][Oø૦ѳσo][Vѵv][Eёeē][Llℓɭ]\.\s?[Cƈcç][O૦σøoѳ][M๓ɱm]\.?/g,
'',
/<p>\s*(?:(?:This (?:chapter is updated by|content is taken from)|Follow current novels on|Updated from) )?(?:[ƒfF][Rrɾг][Eēeё][Eēёe][Wwω][Eёēe][Bbɓ][Nnɳη][Oø૦ѳσo][Vѵv][Eёeē][LlℓɭI\|]\.\s?[Cƈcç][O૦σøoѳ][M๓ɱm]|ꜰʀᴇᴇᴡᴇʙɴᴏᴠᴇʟ)\.?/g,
'<p>',
)
.replace(
/(?<=<p>\s*)Visit for the best novel reading experience\.?/g,
'',
);
.replace(/<p>\s*Visit for the best novel reading experience\.?/g, '<p>');
}
async searchNovels(searchTerm: string): Promise<Plugin.NovelItem[]> {