From 5be966c2ed6d1f1692dbb308557373d67216a7e7 Mon Sep 17 00:00:00 2001 From: RibatTRW Date: Sun, 27 Sep 2026 14:37:41 +0300 Subject: [PATCH 1/2] fix(lightnovelwp): parse chapter text when bottomnav is absent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parseChapter anchored the chapter text on a `bottomnav` div to close the `epcontent` block. Current versions of the theme no longer emit that wrapper, so the match returned undefined and every chapter parsed as an empty string — no error, just blank text on affected sources. Close the block at whichever structural landmark follows it (bottomnav, a script tag, or ), and fall back to the whole document when no epcontent block is present at all. This also drops the regex's hard-coded `epcontent ` class spelling, which would not match `class="epcontent entry-content"` when epcontent is the only class. Output is byte-identical to the old expression on pages that still have bottomnav, verified against captured markup, so the other lightnovelwp sources are unaffected. Kol Novel was the source that surfaced this. Co-Authored-By: Claude Code --- plugins/multisrc/lightnovelwp/template.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/multisrc/lightnovelwp/template.ts b/plugins/multisrc/lightnovelwp/template.ts index 8234b5cf4..cb1ef7676 100644 --- a/plugins/multisrc/lightnovelwp/template.ts +++ b/plugins/multisrc/lightnovelwp/template.ts @@ -438,11 +438,16 @@ export class LightNovelWPPlugin implements Plugin.PluginBase { throw error; } } + // The chapter text lives in the `epcontent` block. Older child themes + // closed it with a `bottomnav` div, but that wrapper is gone on current + // ones, so anchoring on it silently returned an empty chapter. Cut the + // block off at the next structural landmark instead, whichever is + // present, and fall back to the whole document when none of them is. + const content = data.match( + /]*class="[^"]*\bepcontent\b[^"]*"[^>]*>([^]*?)(?=]*class="?bottomnav|]*>([^]*?)<\/p>/g) - ?.join('\n') || '' + (content?.[1] ?? data).match(/]*>([^]*?)<\/p>/g)?.join('\n') || '' ); } From d89b9e2a2a17d934b502b47b613d0dde4297ce77 Mon Sep 17 00:00:00 2001 From: RibatTRW Date: Sun, 27 Sep 2026 18:36:24 +0300 Subject: [PATCH 2/2] fix(lightnovelwp): bound chapter extraction to the epcontent element MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to the bottomnav fix. Cutting the document at the next `