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 {
|
||||
id = 'novelfire';
|
||||
name = 'Novel Fire';
|
||||
version = '1.1.4';
|
||||
version = '1.1.5';
|
||||
icon = 'src/en/novelfire/icon.png';
|
||||
site = 'https://novelfire.net/';
|
||||
|
||||
@@ -195,8 +195,13 @@ class NovelFire implements Plugin.PluginBase {
|
||||
const loadedCheerio = await this.getCheerio(url, false);
|
||||
|
||||
const chapterText = loadedCheerio('#content');
|
||||
|
||||
loadedCheerio(chapterText).find('div').remove();
|
||||
const odds = chapterText.find(':not(p, h1, span, i, b, u, img, a, div)');
|
||||
for (const ele of odds.toArray()) {
|
||||
const tag = ele.name.toString();
|
||||
if (tag.length > 5) {
|
||||
loadedCheerio(ele).remove();
|
||||
}
|
||||
}
|
||||
|
||||
return chapterText.html()?.replace(/ /g, ' ') || '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user