Repository navigation
fix(english/freewebnovel): restore shuffled paragraph order - #2776
Open
Gourab0002 wants to merge 1 commit into
Open
Gourab0002 wants to merge 1 commit into
Gourab0002 wants to merge 1 commit into
Conversation
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 encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance and include this reference: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2771
What changed
plugins/multisrc/readnovelfull/sources.json(Free Web Novel only): thecustomJsnow 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.jsputs them back in order using each child'sdata-reader-order-index, or the inlinestyle="order:N"if the data attribute was stripped. It skipsdata-reader-order-anchorad 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 leftoverorderstyles and index attributes. It only runs whendata-reader-order="pending"is present, so unshuffled chapters don't change.Verification
data-reader-order-indexandstyle="order"attributes plus an ad anchor, then ran the site's realreader-content-order.json 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 eslinton 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'sfetchgets a 403 from my network (curl works). The same thing happens on master.Risks