diff --git a/plugins/multisrc/readnovelfull/sources.json b/plugins/multisrc/readnovelfull/sources.json index 31189bf08..78712f436 100644 --- a/plugins/multisrc/readnovelfull/sources.json +++ b/plugins/multisrc/readnovelfull/sources.json @@ -67,7 +67,9 @@ "options": { "latestPage": "latest-release-novel", "searchPage": "search", - "chapterListing": "ajax-chapter-option" + "chapterListing": "ajax-chapter-option", + "versionIncrements": 1, + "listClass": "fwn-archive-main" } }, { diff --git a/plugins/multisrc/readnovelfull/template.ts b/plugins/multisrc/readnovelfull/template.ts index f1e9a76bb..24aa4b262 100644 --- a/plugins/multisrc/readnovelfull/template.ts +++ b/plugins/multisrc/readnovelfull/template.ts @@ -27,6 +27,7 @@ type ReadNovelFullOptions = { customJs?: string; chapterListPaginated?: boolean; imageReferer?: boolean; + listClass?: string; }; export type ReadNovelFullMetadata = { @@ -77,6 +78,13 @@ export class ReadNovelFullPlugin implements Plugin.PluginBase { let tempNovel: Partial = {}; let depth: number; + const { listClass } = this.options; + const isListStart = (cls?: string) => { + if (!cls) return false; + if (listClass) return cls.split(/\s+/).includes(listClass); + return cls.includes('archive') || cls === 'col-content'; // legacy behaviour + }; + const stateStack: ParsingState[] = [ParsingState.Idle]; const currentState = () => stateStack[stateStack.length - 1]; const pushState = (state: ParsingState) => stateStack.push(state); @@ -87,8 +95,8 @@ export class ReadNovelFullPlugin implements Plugin.PluginBase { onopentag: (name, attribs) => { const state = currentState(); if ( - attribs.class?.includes('archive') || - attribs.class === 'col-content' + isListStart(attribs.class) && + (!listClass || state === ParsingState.Idle) ) { pushState(ParsingState.NovelList); depth = 0;