Skip to content

fix(english): show Re:Library chapter text and parse redesigned listings - #2698

Open
RibatTRW wants to merge 3 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-relibrary-worldgate
Open

RibatTRW wants to merge 3 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-relibrary-worldgate

Conversation

@RibatTRW

@RibatTRW RibatTRW commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #2688.

On Re:Library, Worldgate Online chapters after Chapter 0 opened empty. From Chapter 1 onward the site wraps the whole chapter, credits table included, in div.ppw-restricted-content. The plugin always removed the element right after the top navigation <hr>, assuming it was the credits table, so it deleted the chapter. Chapter 0 worked because its credits table sits outside the wrapper. The same assumption also dropped the first paragraph of chapters with no credits table (for example Arifureta chapter 2).

This PR also fixes the popular and latest listings, which were already broken on master by the site redesign: popular returned no novels, and latest names included the whole card text. That break made the Plugin Live Check fail at popularNovels before it could test chapter loading. It is kept as a separate commit.

This PR was written by an AI agent (Claude Code) and checked against the live site; please weigh the review accordingly.

What Changed

  • parseChapter in plugins/english/relibrary.ts no longer removes the whole element after the top navigation <hr>. It now removes only the credits table, whether that table follows the <hr> directly or is the first child of a wrapper such as div.ppw-restricted-content. Previously the wrapper held the whole chapter, so removing it left chapters empty. This addresses Worldgate Online has no chapters except Ch. 0 #2688, where every chapter except Chapter 0 of Worldgate Online opened blank.
  • parseChapter now throws a clear error instead of returning empty content in three cases:
    • the chapter is password protected (early access);
    • the HTTP response is not OK;
    • no chapter text is found.
  • The chapter HTML also drops script, style and noscript elements, on* attributes, and javascript:, vbscript: and non-image data: URLs in href and src.
  • The popular and latest novel listing parsers are updated for the redesigned site markup, using .relibrary-novel-card, .relibrary-title and img.relibrary-cover. Both now throw on a non-OK HTTP response.
  • The plugin version is bumped from 1.0.3 to 1.0.4.

Risk Assessment

✅ Low: The change is a bounded fix to one scraper plugin: it stops removing the wrapper div that holds the chapter body and adds guards that throw on HTTP errors or empty output. I found no new defect.

Testing

I ran the live checker on the plugin, which passed popular, search, novel and chapter parsing. I then drove the real Worldgate Online novel: it lists 41 chapters, and the chapters wrapped in ppw-restricted-content (volume 1, chapters 1 and 5) now return 13–14k characters of readable story text. The last chapter is early-access locked and throws an explicit password-protected error with its unlock date instead of returning empty HTML. Playground screenshots are in the section below.

  • Live validation: ✅ go - 4 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Open a wrapped Worldgate chapter (vol 1 ch 1 and ch 5), which was previously empty; it now returns story text ✅ pass live worldgate.txt; text starts 'The moment I noticed signs of a magic spell being cast...'
Open Worldgate Chapter 0 and the live checker's sample chapter; both still render ✅ pass live check:plugin all PASS; ch0 returned 15327 chars
Open a locked early-access chapter; it throws a clear error rather than returning empty ✅ pass live Last Worldgate chapter threw 'password protected (early access) ... unlock on Nov 16, 2026'
Load Worldgate's novel page and chapter list (41 chapters) plus popular and search listings via the redesigned selectors ✅ pass live check:plugin: 30 popular novels, 3 search results, 413 chapters for the sample novel
Playground screenshots for the PR ✅ pass live Captured afterwards in the plugin playground; see "Playground screenshots" below.
Evidence: Worldgate chapter HTML samples
/translations/worldgate-online/volume-1/chapter-1-worldgate-online/
<div class="code-block code-block-52" style="margin: 8px 0; clear: both;">
<table class="rounded"><tbody><tr>
		  <td style="vertical-align: middle;background-color: #7393b3!important;border-radius: 15px 15px 0px 0px;text-align: center"><span style="font-size: 18pt;font-weight: bold;color: #999999"><a href="https://re-library.com/tag/project-necro/">Project Necro</a> is an official initiative by Re:Library.</span></td>
		  </tr>
		  <tr>
		  <td style="vertical-align: middle;background-color: #dce0e3;border-radius: 0px 0px 15px 15px;text-align: center"><a href="https://ko-fi.com/projectnecro" target="_blank" rel="nofollow noopener"><img src="https://re-library.com/wp-content/uploads/2025/11/kofi-e1763448759698.webp" alt="Ko-fi" title="Ko-fi"></a></td>
		</tr></tbody></table></div>

<p><span id="more-123809"></span><br>
</p><div class="ppw-restricted-content">
<p>It was a game they say was born from the mind of a single genius.</p>
<p>His name was Aureo Uber, and it was in a certain major nation that he made his sudden debut on the world stage as a prodigious scientist.</p>
<p>Strange was that nobody knew who he was or where he came from, and he’d been a complete anonym with no particularly notable results to his name until then.</p>
<p>What brought about his abrupt emergence and catapulted him to fame was this: Total success in the until-then stagnant field of intracerebral signal analysis, upon which his new technology almost magically took the concept of a full-dive VR set—

-----
/translations/worldgate-online/volume-1/chapter-1-deep-beneath-the-earth/
<div class="ppw-restricted-content">
<div class="code-block code-block-52" style="margin: 8px 0; clear: both;">
<table class="rounded"><tbody><tr>
		  <td style="vertical-align: middle;background-color: #7393b3!important;border-radius: 15px 15px 0px 0px;text-align: center"><span style="font-size: 18pt;font-weight: bold;color: #999999"><a href="https://re-library.com/tag/project-necro/">Project Necro</a> is an official initiative by Re:Library.</span></td>
		  </tr>
		  <tr>
		  <td style="vertical-align: middle;background-color: #dce0e3;border-radius: 0px 0px 15px 15px;text-align: center"><a href="https://ko-fi.com/projectnecro" target="_blank" rel="nofollow noopener"><img src="https://re-library.com/wp-content/uploads/2025/11/kofi-e1763448759698.webp" alt="Ko-fi" title="Ko-fi"></a></td>
		</tr></tbody></table></div>

<p>The moment I noticed signs of a magic spell being cast, I immediately took cover behind a rock and counted to five.<br>
I spun around and darted out. I directed my gaze toward the ruins of an underground city far below the cliff—and just as I had expected, the enemy had lost sight of me. A one-eyed giant clad in ornate armor and wielding a massive jet-black sword, its body in a gruesome state, with flesh crumbling away from its limbs and exposing bare bones and muscle. Since it had lost track of its target, its magic failed to activate, leaving it immobile for the duration of both the casting time and the post-cast delay.</p>
<p>If my timing were off by even 

-----
/translations/worldgate-online/volume-1/chapter-5-worldgate-offline-2/
<div class="ppw-restricted-content">
<div class="code-block code-block-52" style="margin: 8px 0; clear: both;">
<table class="rounded"><tbody><tr>
		  <td style="vertical-align: middle;background-color: #7393b3!important;border-radius: 15px 15px 0px 0px;text-align: center"><span style="font-size: 18pt;font-weight: bold;color: #999999"><a href="https://re-library.com/tag/project-necro/">Project Necro</a> is an official initiative by Re:Library.</span></td>
		  </tr>
		  <tr>
		  <td style="vertical-align: middle;background-color: #dce0e3;border-radius: 0px 0px 15px 15px;text-align: center"><a href="https://ko-fi.com/projectnecro" target="_blank" rel="nofollow noopener"><img src="https://re-library.com/wp-content/uploads/2025/11/kofi-e1763448759698.webp" alt="Ko-fi" title="Ko-fi"></a></td>
		</tr></tbody></table></div>

<p>Despite it being early summer, I found myself deep within a long coniferous forest where snow still lay thick on the ground.<br>
Beyond the barely discernible cobblestones of a decaying old road stood a single, dilapidated building.</p>
<p>Inside what appeared to be a temple—now completely in ruins—there was none of the cold damage that had plagued me throughout my journey, despite its dilapidated exterior. I made my way through the building, free of enemies, without incident.</p>
<p>In the final room I reached, there was a warp gate—the kind I’d seen countless times in the game. Passing through the gate, just as I had expected, I found myself in a mysterious

Playground screenshots

Captured in the repository's plugin playground (npm run dev:start) at commit 9a3c3f0 (the later commit only attaches the HTTP status to thrown errors), driven in headless Chromium. Two test-harness adjustments: the browser sent a regular Chrome user agent, because re-library.com returns 403 to HeadlessChrome; and cover requests carried the plugin's declared imageRequestInit Referer (https://re-library.com/), which the app applies but the playground's plain <img> tags do not.

Re:Library popular novels (30, with covers)

Playground: Re:Library popular novels (30, with covers)

Re:Library latest novels with clean names

Playground: Re:Library latest novels with clean names

search for Worldgate

Playground: search for Worldgate

Worldgate Online novel details

Playground: Worldgate Online novel details

Worldgate Online chapter list (41 chapters)

Playground: Worldgate Online chapter list (41 chapters)

Worldgate Online Chapter 1 text (13123 characters)

Playground: Worldgate Online Chapter 1 text (13123 characters)

early-access Chapter 29 shows an unlock-date error

Playground: early-access Chapter 29 shows an unlock-date error

CI note

On the GitHub runner, re-library.com answers with HTTP 403 (Cloudflare), so the Plugin Live Check reports INCONCLUSIVE there. The listing and chapter request errors now carry the HTTP status, so a block like this shows as INCONCLUSIVE instead of FAIL. From a regular connection, npm run check:plugin -- plugins/english/relibrary.ts passes all four checks.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Open a wrapped Worldgate chapter (vol 1 ch 1 and ch 5), which was previously empty; it now returns story text ✅ pass live worldgate.txt; text starts 'The moment I noticed signs of a magic spell being cast...'
Open Worldgate Chapter 0 and the live checker's sample chapter; both still render ✅ pass live check:plugin all PASS; ch0 returned 15327 chars
Open a locked early-access chapter; it throws a clear error rather than returning empty ✅ pass live Last Worldgate chapter threw 'password protected (early access) ... unlock on Nov 16, 2026'
Load Worldgate's novel page and chapter list (41 chapters) plus popular and search listings via the redesigned selectors ✅ pass live check:plugin: 30 popular novels, 3 search results, 413 chapters for the sample novel
Playground screenshots for the PR ⏸️ untested no Screenshots were not captured in this test phase; the PR delivery step still needs them.
  • npm ci
  • npm run check:plugin -- plugins/english/relibrary.ts (all four checks passed)
  • Bundled the plugin with esbuild and ran parseNovel(&#39;/translations/worldgate-online/&#39;) plus parseChapter on chapters 0, 1, 5 and the last chapter against the live site
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

🤖 Generated with Claude Code

…ation

parseChapter removed whatever element followed the top navigation <hr>,
assuming it was the author/translator credits table. On Worldgate Online
chapter 1 onwards that element is div.ppw-restricted-content, which holds
the whole chapter, so those chapters came back empty; on chapters with no
credits table (e.g. Arifureta) the first paragraph was dropped. Only
remove the credits table itself.

Also report early access (password protected) chapters and refused
responses with a clear error instead of returning the password form or
an empty chapter, and strip event handlers and script URLs from the
returned HTML.

Closes lnreader#2688
Re:Library replaced the most-popular list with div.relibrary-novel-card
cards, so popularNovels returned no novels, and the latest listing's
title heading now wraps a whole novel card, so names came back with the
card's text. Read the card title, link, and cover instead, and throw with
the HTTP status when the listing request is refused.
@RibatTRW
RibatTRW marked this pull request as draft October 17, 2026 13:40
@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the remaining request for repeatable chapter tests is non-blocking.

Findings

  1. P2 Chapter fix lacks regression coverage ▶

Summary

Fixes Re:Library chapter loading and updates listings for the redesigned site.

  • Re:Library chapters keep their story text when credits sit in a wrapper.
  • Re:Library lists show novel cards from the redesigned pages.

Reviews (2) · Last reviewed commit: "no-mistakes(ci): The Plugin Live Check f..." · Reviewed by Greptile

Comment on lines +384 to +386
const afterNav = pageLinkHr.next();
if (afterNav.is('table')) afterNav.remove();
else afterNav.children().first().filter('table').remove();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Chapter fix lacks regression coverage

The wrapper-preserving fix in parseChapter has no repeatable check. The existing live check opens only the first chapter, but the reported failure affects chapters after Chapter 0. A later cleanup change could therefore bring back blank chapters unnoticed.

Add saved HTML cases for a credits table inside div.ppw-restricted-content, a standalone credits table, and a chapter starting with a paragraph. Check that chapter text survives and credits are removed.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

…urning HTTP 403 to the CI runner. I changed the three `!result.ok` throws in `plugins/english/relibrary.ts` (`popularNovelsInner`, `lastestNovelsInner`, `parseChapter`) to throw `Object.assign(new Error(...), { status: result.status, response: result })`, as `ao3.ts` does. The error messages are unchanged. I haven't confirmed that `isNetworkOrBlockError()` in `scripts/live-check-plugin.js` now reports a 403/503 as INCONCLUSIVE, because I didn't reproduce a block locally. Prettier and eslint are clean. `npm run check:plugin` passes all four checks locally: 30 popular novels, 3 search results, 413 chapters, 17265 chars of chapter text. The CI job itself hasn't been re-run
@RibatTRW
RibatTRW marked this pull request as ready for review October 18, 2026 00:26

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.

Worldgate Online has no chapters except Ch. 0

1 participant