Skip to content

Fix processing comments in XML#2886

Merged
mzagozen merged 1 commit into
mainfrom
xml-comment
Jun 5, 2026
Merged

Fix processing comments in XML#2886
mzagozen merged 1 commit into
mainfrom
xml-comment

Conversation

@mzagozen
Copy link
Copy Markdown
Collaborator

@mzagozen mzagozen commented Jun 5, 2026

When collecting element text (text and CDATA), skip over comments that appear before the current node closing tag or another child node opening tag. Unsupported nodes (entity references, processing instructions) are rejected.

Closes #2849

When collecting element text (text and CDATA), skip over comments.
Unsupported nodes (entity references, processing instructions) are
rejected.
@mzagozen
Copy link
Copy Markdown
Collaborator Author

mzagozen commented Jun 5, 2026

We still don't have a way of representing comments in the std.xml.Node object (also see #2148 (comment)), but this fixes the immediate problem of parsing an XML document with inlined comments.

@mzagozen mzagozen merged commit 4e4f675 into main Jun 5, 2026
87 of 90 checks passed
@mzagozen mzagozen deleted the xml-comment branch June 5, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XML comment followed by more characters

1 participant