Repository navigation
Conversation
The text child of a CDATA node is not added via addNode, so with withStartIndices its startIndex stayed null (endIndex was only set because ontext updates it). Copy both indices from the CDATA node.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
[Low impact] The PR appears safe to merge; no actionable issues were found.
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
With
withStartIndices, the text node inside a CDATA node always hasstartIndex: null.oncdatastartcreates the text child itself and never passes it throughaddNode, so the start index is never set. The end index only works becauseontextupdatesendIndexon the last text node. Same withrecognizeCDATAin HTML mode.Fix: copy both indices from the CDATA node to its text child. That matches how a comment's text gets the comment's range.
Test: new fixture
28-cdata-indices.json(runs both char-by-char and in one go). It fails on main (expected null to be 3) and passes with the fix.npm test(vitest + lint) is green.Found while fuzzing node indices from htmlparser2.
Summary by CodeRabbit