Repository navigation
fix(xml): preserve declaration state through embedded markup - #5249
Conversation
Size Report
Startup median (7 runs, lower is better):
Affected plugins
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on fdf3683. The verdict and the full list are in the summary comment.
|
At 21d5b3d, one regression needs a fix: some comment input that parsed on the base now throws or silently loses elements.
Not blocking, so take or leave these: The earlier high-priority thread on markup outside the subset no longer applies and can be resolved: both the comment and PI forms return the root, because the skip now runs only when The lint, typecheck and package, coverage, integration, repo guard, smoke, body rules and CodeQL checks passed. One other check is still queued and does not run the changed code. Not verified here: test files and local gates were not run. Behavior was checked by loading the base and head parser in memory with the entity decoder replaced by an identity function. The generated inputs used a small alphabet, so they show the classes of difference but do not prove there are no others. Production callers (Apple usbmux, xctestrun, plist and perf parsing, and WebDriver page source) were found by search and not exercised live. Before merge, restore the closing-token search offset and add the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on bba0594. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
|
At ee56e1c, no code problem remains. The earlier regression is fixed: the closing-token search starts at the old offset again, The thread on subset closers can be resolved: a CI shows 20 checks passed, none failed and Proof skipped. One other check is still pending and runs none of the changed code, so it should finish before merge. The branch is behind main, but main has no newer change in Not verified here: local tests and gates were not run. Behavior was checked by loading the parser in memory with the entity decoder replaced by an identity function. A comparison of 1.5M generated inputs used a small alphabet; it showed no difference from the base without a successful subset skip, but it is not a proof. Production callers (usbmux plist, xctestrun, plist, perf XML and WebDriver page source) were found by search and not exercised live, and output from external producers was not sampled. |
Apex Sentinel · ✅ Approve · review of
|
| Finding | Fixed by | Where |
|---|---|---|
Complete comment/PI inside a DOCTYPE subset that holds the subset's ] now aborts the parse |
thymikee | 92afc4f · reply |
1 new finding away from what changed since 83aecbf not shown. Comment @apex-sentinel-staging review for a full review.
Reviewed with this repository's own Sentinel configuration (34810b99604e).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
Summary
The declaration scanner skips complete comments and processing instructions inside an unquoted bracketed subset. When their closing delimiter is absent, it continues the base parser’s quote and bracket scan. Each absent delimiter requires at most one search to the end of the document.
Before / after
On the PR base, an apostrophe or literal
]>inside a complete embedded comment or processing instruction could hide the following root or prematurely end the declaration. The parser now skips to the markup’s own closer and returns the root.Both the base and this head return
rootfor<!DOCTYPE root [<!-- x <a> b]><root/>and its processing-instruction counterpart. Top-level markup keeps its historical delimiter search offset and missing-closer errors.All four reviewed inputs with a complete comment or PI containing
]>and no external subset closer now raiseXML declaration is not closed.The base returnedrootby ending the declaration inside the embedded markup. Adding an external]>returnsrooton this head.Validation
CI pending at
ee56e1c34d113d47aceb79b7c82e0c6a345ac8db. Public-parser cases cover complete and unterminated subset markup, overlapping comment delimiters, and unterminated top-level markup. Validation is CI-only.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.