From c8b8ad20645333b8bf14f3b36facd8664142f7e7 Mon Sep 17 00:00:00 2001 From: Raiyn Aydin Date: Wed, 30 Sep 2026 17:06:31 +0800 Subject: [PATCH 1/2] fix(lightnovelwp): keep images and paragraph HTML in chapters #2593 replaced the bottomnav-anchored regex with a walk that collected only the text of

elements. Illustration chapters hold images and no prose, so they came back empty, and ordinary chapters lost inline images and formatting. Select the first div.epcontent with cheerio and return its paragraphs as HTML plus any images outside a paragraph, resolving lazy-load and relative sources to absolute URLs. Scripts, styles and noscript are dropped. A missing epcontent block still returns '' and bottomnav is not needed. Bump the template version so every source picks up the fix. Closes #2610 --- plugins/multisrc/lightnovelwp/template.ts | 89 +++++++++-------------- 1 file changed, 35 insertions(+), 54 deletions(-) diff --git a/plugins/multisrc/lightnovelwp/template.ts b/plugins/multisrc/lightnovelwp/template.ts index 080b4a452..82d40c4ed 100644 --- a/plugins/multisrc/lightnovelwp/template.ts +++ b/plugins/multisrc/lightnovelwp/template.ts @@ -42,7 +42,7 @@ export class LightNovelWPPlugin implements Plugin.PluginBase { this.icon = `multisrc/lightnovelwp/${metadata.id.toLowerCase()}/icon.png`; this.site = metadata.sourceSite; const versionIncrements = metadata.options?.versionIncrements || 0; - this.version = `1.1.${10 + versionIncrements}`; + this.version = `1.1.${11 + versionIncrements}`; this.options = metadata.options ?? ({} as LightNovelWPOptions); this.filters = metadata.filters satisfies Filters; @@ -438,64 +438,45 @@ 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. - // - // Walk the markup with the parser rather than cutting the document with a - // regex: the block has to end at the element that closes it, and any - // landmark guessed from the surrounding text is wrong on some site. A - //