Skip to content

fix(english/freewebnovel): restore shuffled paragraph order - #2776

Open
Gourab0002 wants to merge 1 commit into
lnreader:masterfrom
Gourab0002:fix/english-freewebnovel-paragraph-order
Open

Gourab0002 wants to merge 1 commit into
lnreader:masterfrom
Gourab0002:fix/english-freewebnovel-paragraph-order

Conversation

@Gourab0002

Copy link
Copy Markdown
Contributor

Fixes #2771

What changed

  • plugins/multisrc/readnovelfull/sources.json (Free Web Novel only): the customJs now restores paragraph order before the existing text cleanup runs. Version goes from 2.3.8 to 2.3.9.

Why

Free Web Novel sometimes serves <div id="article" data-reader-order="pending" data-reader-order-count="N"> with its child paragraphs shuffled (the CSS masks the shuffled tail). The site's own /static/freewebnovel/js/reader-content-order.js puts them back in order using each child's data-reader-order-index, or the inline style="order:N" if the data attribute was stripped. It skips data-reader-order-anchor ad blocks and moves the indexed nodes back into their original slots. The plugin didn't run that script, so readers got sentences out of order. The fix copies that logic with cheerio and removes the leftover order styles and index attributes. It only runs when data-reader-order="pending" is present, so unshuffled chapters don't change.

Verification

  • Before/after test: I took a live chapter (emperor-of-the-source/chapter-487, 63 paragraphs), shuffled its second half with mixed data-reader-order-index and style="order" attributes plus an ad anchor, then ran the site's real reader-content-order.js on it in jsdom to get the browser order. Before the fix, the plugin output didn't match the browser order. After the fix, it matched the browser order and the original chapter text, on 2 runs.
  • npx tsc --project tsconfig.production.json --noEmit: passes.
  • npx eslint on the generated plugin and template: 0 errors (there's one existing unused-var warning in the template).
  • npm run build:full: passes.
  • npm run check:plugin -- "plugins/english/FreeWebNovel[readnovelfull].ts": Inconclusive, because Node's fetch gets a 403 from my network (curl works). The same thing happens on master.

Risks

  • In my session the site wasn't serving shuffled pages (40+ recent chapters came back unshuffled), so I tested against the site's own restore script instead of a captured shuffled page.
  • No other readnovelfull sources are affected, since only this source's config changed.

FreeWebNovel now serves some chapters with #article children shuffled and
restores them client-side (reader-content-order.js) from
data-reader-order-index / inline CSS order. Apply the same restore in the
plugin's customJs. Bump Free Web Novel to 2.3.9.

Fixes lnreader#2771

Co-Authored-By: Grok Bot (AI agent)
@greptile-apps

greptile-apps Bot commented Oct 25, 2026

Copy link
Copy Markdown

Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance and include this reference: d7655364-53b6-430a-b924-ad87d1db9356.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sentence rearrangement in updated novels

1 participant