fix: Remove Tags From Text (#1972)
* Fix (novelfire): Remove plugs * Fix (novelfire): Remove plugs 2.0
This commit is contained in:
@@ -8,7 +8,7 @@ import { defaultCover } from '@/types/constants';
|
|||||||
class NovelFire implements Plugin.PluginBase {
|
class NovelFire implements Plugin.PluginBase {
|
||||||
id = 'novelfire';
|
id = 'novelfire';
|
||||||
name = 'Novel Fire';
|
name = 'Novel Fire';
|
||||||
version = '1.1.4';
|
version = '1.1.5';
|
||||||
icon = 'src/en/novelfire/icon.png';
|
icon = 'src/en/novelfire/icon.png';
|
||||||
site = 'https://novelfire.net/';
|
site = 'https://novelfire.net/';
|
||||||
|
|
||||||
@@ -195,8 +195,13 @@ class NovelFire implements Plugin.PluginBase {
|
|||||||
const loadedCheerio = await this.getCheerio(url, false);
|
const loadedCheerio = await this.getCheerio(url, false);
|
||||||
|
|
||||||
const chapterText = loadedCheerio('#content');
|
const chapterText = loadedCheerio('#content');
|
||||||
|
const odds = chapterText.find(':not(p, h1, span, i, b, u, img, a, div)');
|
||||||
loadedCheerio(chapterText).find('div').remove();
|
for (const ele of odds.toArray()) {
|
||||||
|
const tag = ele.name.toString();
|
||||||
|
if (tag.length > 5) {
|
||||||
|
loadedCheerio(ele).remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return chapterText.html()?.replace(/ /g, ' ') || '';
|
return chapterText.html()?.replace(/ /g, ' ') || '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user