Repository navigation
feat(turkish/rezeroturkce): add Re:Zero Türkçe source - #2648
Conversation
Add a plugin for rezeroturkce.com. Each story page (main-story arcs, IF routes, EX novels) is a novel and the side-story index is one novel; chapters are the on-site links on each story page, with release dates from the site's reading-progress table. Links that point to EpikNovel are skipped because that site does not respond. Closes lnreader#2637
|
| content | ||
| .find( | ||
| 'script, style, noscript, iframe, ins, .wp-block-post-navigation-link', | ||
| ) | ||
| .remove(); |
There was a problem hiding this comment.
parseChapter removes script elements but keeps executable attributes and links. Site HTML such as <img src="invalid" onerror="alert(document.domain)"> survives this cleanup. The playground inserts the result directly through dangerouslySetInnerHTML, so the handler runs as part of the playground page. Strip event-handler attributes and script URLs before returning chapter HTML.
How this was verified: The chapter cleanup preserves image attributes, and the playground passes the returned HTML directly into its page without cleaning it.
There was a problem hiding this comment.
Fixed in 40a4bcc: parseChapter now removes on* attributes and javascript: URLs from the returned HTML (a synthetic <img onerror> / <a href="javascript:"> / onclick input came back without them). — reply from the AI agent (Claude) that authored this PR
| if (/cevirisi tamamlan/.test(normalize(article.find('h2').text()))) | ||
| novel.status = NovelStatus.Completed; |
There was a problem hiding this comment.
Unfinished stories look completed
The completion check matches a word stem rather than an affirmative statement. If a heading says Çevirisi tamamlanmadı or Çevirisi tamamlanıyor, it matches /cevirisi tamamlan/ and marks the story as completed, even though neither phrase says the translation is finished. Match explicit completed wording and add cases for negative and ongoing wording so those headings leave status as Unknown.
There was a problem hiding this comment.
Fixed in 40a4bcc: status is now Completed only for "tamamlanmıştır"/"tamamlandı". Checked locally: "tamamlanmadı", "tamamlanıyor" and "Devam Ediyor" stay Unknown, while the live Kısım VII page is still Completed. There is no unit-test suite in this repo to add cases to. — reply from the AI agent (Claude) that authored this PR
…atch Remove on* attributes and javascript: URLs from chapter HTML, and only mark a story completed for "tamamlanmıştır"/"tamamlandı", not for wording such as "tamamlanmadı".
Adds a Turkish source for Re:Zero Türkçe.
Closes #2637
How it maps the site
/ana-hikaye/kisim-N/), IF route and EX volume is one novel, and the side-story index (/yan-hikayeler/) is one novel whose chapters are the individual side stories.Completedonly when the page says the translation is complete; otherwise it'sUnknown. Author isn't set because the site doesn't state it.Testing
The whole site is behind a Cloudflare challenge. A headed browser passes it, but plain HTTP clients get 403.
npm run check:plugin -- plugins/turkish/rezeroturkce.ts: INCONCLUSIVE (siteReachability: HTTP 403 Cloudflare). It did not get past the challenge.cf_clearancecookie and User-Agent to the bundled plugin and to the playground proxy (/settingscookies). With that:popularNovels: 17 stories with covers.parseNovel: Kısım V–VIII and X, Rem IF, EX 1 and side stories returned summaries and chapter lists. For example, Kısım VII has 116 chapters with dates and Kısım X has 30.parseChapter: main-arc, IF and side-story chapters returned their text, with scripts/styles, prev/next navigation, the[adinserter]shortcode, inlineon*handlers andjavascript:URLs removed.searchNovels: matches Turkish text with or without diacritics (e.g.öfke,kisim).npm run dev:start): fetched the popular list, parsedana-hikaye/kisim-10/(summary, 30 chapters, dates) and read a chapter's text.<img>requests. I have not checked how they behave in the app.npx prettier --checkandnpx eslinton the new file pass.npm run build:compilepasses. Repo-widenpm run lintstill reports 3 errors, all in other plugins (rewayatfans.ts,wetriedtls.ts,wntl.ts).This PR was written by an AI agent (Claude); no human has reviewed it yet.