FreeWebNovel: small fix (#1661)
This commit is contained in:
@@ -7,7 +7,7 @@ class FreeWebNovel implements Plugin.PluginBase {
|
|||||||
id = 'FWN.com';
|
id = 'FWN.com';
|
||||||
name = 'Free Web Novel';
|
name = 'Free Web Novel';
|
||||||
site = 'https://freewebnovel.com/';
|
site = 'https://freewebnovel.com/';
|
||||||
version = '2.0.1';
|
version = '2.0.2';
|
||||||
icon = 'src/en/freewebnovel/icon.png';
|
icon = 'src/en/freewebnovel/icon.png';
|
||||||
|
|
||||||
lastSearch: number | null = null;
|
lastSearch: number | null = null;
|
||||||
@@ -262,9 +262,10 @@ class FreeWebNovel implements Plugin.PluginBase {
|
|||||||
|
|
||||||
const parser = new Parser({
|
const parser = new Parser({
|
||||||
onopentag(name, attribs) {
|
onopentag(name, attribs) {
|
||||||
|
const attrib = attribs.class?.trim();
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case ParsingState.Idle:
|
case ParsingState.Idle:
|
||||||
if (attribs.id === 'article') {
|
if (attrib === 'txt') {
|
||||||
state = ParsingState.Chapter;
|
state = ParsingState.Chapter;
|
||||||
depth++;
|
depth++;
|
||||||
}
|
}
|
||||||
@@ -283,6 +284,7 @@ class FreeWebNovel implements Plugin.PluginBase {
|
|||||||
chapterHtml.push(`<${name}>`);
|
chapterHtml.push(`<${name}>`);
|
||||||
} else if (attrKeys.every(key => attribs[key].trim() === '')) {
|
} else if (attrKeys.every(key => attribs[key].trim() === '')) {
|
||||||
// Handle tags with empty attributes as text content
|
// Handle tags with empty attributes as text content
|
||||||
|
// eg: novel/rising-up-from-a-nobleman-to-intergalactic-warlord/chapter-184
|
||||||
skipClosingTag = true;
|
skipClosingTag = true;
|
||||||
currentTagToSkip = name;
|
currentTagToSkip = name;
|
||||||
const uppercaseName = name.replace(/\b\w/g, char =>
|
const uppercaseName = name.replace(/\b\w/g, char =>
|
||||||
|
|||||||
Reference in New Issue
Block a user