Repository navigation
feat(english): add Tensurafan source - #2701
Conversation
[Medium impact] Adds a new content source plugin for a fan site. Remove embedded frames from chapter HTML before merging. Findings
SummaryAdds Tensurafan as a single-series English source.
Reviews (1) · Last reviewed commit: "feat(english): add Tensurafan source" · Reviewed by Greptile |
|
|
||
| const $ = loadCheerio(body, null, false); | ||
| // The full-page title card repeats the heading that follows it as text. | ||
| $('script, style, noscript, p.pagebreak').remove(); |
There was a problem hiding this comment.
parseChapter leaves iframe elements and their srcdoc attributes intact. If the source serves malicious chapter HTML, it can put an encoded script inside srcdoc. Removing script elements does not inspect HTML inside an attribute, and the attribute loop ignores srcdoc.
The playground inserts the returned HTML directly, so that script can read or change the playground page. Remove iframe elements before returning chapter HTML.
How this was verified: Remote chapter HTML reaches dangerouslySetInnerHTML, while neither cleanup step removes an unsandboxed iframe containing script in srcdoc.
| $('script, style, noscript, p.pagebreak').remove(); | |
| $('script, style, noscript, iframe, p.pagebreak').remove(); |
There was a problem hiding this comment.
Thanks. parseChapter now also removes iframe, object and embed elements from the chapter HTML (commit e56ddef).
…HTML Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Summary
Adds a new English source for Tensurafan (https://tensurafan.github.io), the fan translation of That Time I Got Reincarnated as a Slime, as requested in #2697. The novel lists every volume plus the side stories and special booklets in reading order, and a plugin setting lets readers choose which of the site's selectable name terms appear in chapters.
What Changed
plugins/english/tensurafan.ts(idtensurafan, v1.0.0), for https://tensurafan.github.io. It exposes the site's That Time I Got Reincarnated as a Slime volumes as chapters. It reads each volume's table of contents with a ranged fetch and parses the chapter content from the volume page.termSetplugin setting (Default / Official / Text-to-speech friendly terms). It mirrors the site's "Set All Terms to ..." choices under Extras > Manage Selectable terms and applies to chapters opened after the change.public/static/src/en/tensurafan/icon.png.Closes #2697
This plugin and PR were authored by an AI agent (Claude Code); please review accordingly.
🤖 Generated with Claude Code
Screenshots
Plugin playground, live against tensurafan.github.io:
Risk Assessment
✅ Low: A new, self-contained plugin with an icon. The live volume list includes booklets (b1, b5) and side stories (8.5, 13.5), and every table of contents ends well within the 24,000-byte range the plugin reads.
Testing
The live check passed all four methods. A direct run showed 157 chapters across Volumes 6-21, the 8.5 and 13.5 side stories and the Special Booklets, with author and artist filled in, and the booklet chapter returned clean HTML. The term-set option behaved correctly: in Volume 6 the default set kept "Souei" 87 times, the official set replaced all 87 with "Soei", and the TTS set kept the default. The playground showed Tensurafan in Popular and Parse Novel, and Parse Chapter rendered a side-story chapter. One gap: the Parse Chapter screenshot is of a side story (8.5), not a booklet.
~/.no-mistakes/evidence/01M566PGVZ6N7REC3EE4E158PN/tensurafan-popular.png)~/.no-mistakes/evidence/01M566PGVZ6N7REC3EE4E158PN/tensurafan-parsenovel.png)~/.no-mistakes/evidence/01M566PGVZ6N7REC3EE4E158PN/tensurafan-parsechapter-sidestory.png)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.
npm run check:plugin -- plugins/english/tensurafan.ts(all 4 checks pass)esbuild-bundled plugin driven directly: parseNovel chapter list, Special Booklets chapter, termSet default/official/tts counts on Volume 6npm run dev:startplayground driven in headless Chromium over CDP: Popular, Parse Novel, Parse Chapter on /read/v8_5#story-1✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.