GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — fix(web): preserve literal entities in EPUB CDATA by StiensWout · Pull Request #36595 · pingdotgg/t3code Conversation
Contributor
EPUB previews decode literal entity examples inside CDATA, so a technical book showing Closes #36594 Small fast-lane fix: local parser logic, no public interface, state, or new UI flow. Proof
Council review
No blockers or should findings. Local cubic found no issues (fork repository context unavailable). Optional nits left: narrow the CDATA parser-shape assertion and broaden the existing ODS case's name. Current parser shape is independently checked and existing tests cover an upgrade breaking it; no behavior change needed. A pre-existing raw-source DOCTYPE/ENTITY filter also interprets declaration examples inside CDATA; separate follow-up, outside this entity-decoding fix. Created with GPT 6.1 Sol (lead, repro, review, browser proof) in the Codex harness and Claude Opus 5.5 (independent verifier, builder, trim, review) in Claude Agent, coordinated through T3 Code.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsfast-xml-parser merged CDATA sections into ordinary text, and the preview decoded every text node, so `<![CDATA[&]]>` rendered as `&`. Keep CDATA as its own node, decode escaped text once in parseXml, and convert CDATA to a literal text node so every text consumer sees the right value. Co-authored-by: GPT 6.1 Sol <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
XML conversion and preview tests apps/web/src/components/files/extendedDocumentPreview.ts, apps/web/src/components/files/FilePreviewPanel.test.ts |
The parser preserves CDATA separately. Conversion retains its literal content, decodes element text, and avoids decoding text nodes again. ODS and EPUB tests check these results. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers: geezoria
7d1e4This fix keeps entity examples inside EPUB CDATA literal in file previews. The change is small and local, with tests for the affected paths, so no merge-blocking risk is evident.
Explanation
The title names the fix and its scope: EPUB CDATA handling so that entity examples stay literal. The raw summary shows the parser change for CDATA and entity decoding in extendedDocumentPreview.ts, and the test changes cover EPUB and ODS, which match the title's focus. The title follows the conventional commit form the template asks for.
Explanation
The description follows the template's main ideas. It gives the problem (EPUB CDATA entity examples decoded), the change (keep CDATA separate and normalize text once at the parser boundary), the scope (linked issue #36594 and a fast-lane bug fix), and verification (a focused test command, a full adjacent test file, check:changed, and manual browser proof with before/after images). The template's sections are not labeled as headings, but the content for each is present. The verification section is detailed, and it names what was not checked (no packaged desktop or mobile run, no epubcheck). The description also has a non-template council review section, which does not affect completeness.
Explanation
Linked issue #36594 is the only active direct target. Its requirement is that EPUB chapter text containing CDATA with &amp;amp; and &amp;lt; previews as the literal strings Use &amp;amp; and &amp;lt; literally. The diff to extendedDocumentPreview.ts at head sets cdataPropName: "#cdata" in the fast-xml-parser options and converts #cdata nodes into #text nodes with the raw CDATA content, without entity decoding. Ordinary text nodes now decode entities once in convert (text: decodeEntities(value)), and the shared text() helper no longer decodes again. This removes the double-decoding path that produced &amp; from CDATA. The test file changes add an EPUB case with the issue's <pre> CDATA payload and an ODS case with escaped text beside CDATA. The author reports these tests pass. I did not run the tests. The code evidence supports the requirement.
Explanation
All changed hunks serve the fix for #36594. The parser option and CDATA branch in parseXml, the decode move from text() to convert, the explanatory comment, and the test updates each support the CDATA-literal and single-decode invariant. The shared ODF renderer uses the same parseXml and text helpers, so the ODS behavior change follows from the shared invariant described in the PR. No unrelated files or features appear in the summary or the inspected diff. The raw-source DOCTYPE/ENTITY filter, which the PR marks as a separate follow-up, is not changed here.
73dedd55-d147-433a-8dd5-14423aa0396dapps/web/src/components/files/FilePreviewPanel.test.tsapps/web/src/components/files/extendedDocumentPreview.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
EvidenceOpen a synthetic EPUB through Files preview. Its chapter contains Proven: the scenario fails on base and passes on head. Base displays
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit d6244ac)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug]: EPUB previews decode literal entity examples inside CDATA
There was an error while loading. Please reload this page.