Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Nov 6, 2025

This adds a little bit better handling when HTML tags are unbalanced or unclosed. It does not implement the HTML standard recovery algorithm, but I think this should be fine. The author mostly just needs to know that there is something wrong.

ehuss added 6 commits November 5, 2025 10:45
This checks for any unclosed elements when processing is finished. This
is intended to detect invalid HTML in the source, or bugs in the tree
builder. Raw HTML elements generate a warning (which in the future will
be a configurable lint). All other sync errors are internal errors as
they are not expected, and it would be helpful to know if they ever
happen.
This changes the internal error message to a warning to let the user
know that the HTML tags are unbalanced. In the future this will be a
denyable lint.

This is a very primitive approach of just ignoring the end tag. Ideally
it should recover using the standard HTML parsing algorithm, since there
is a chance that there will be a cascade of errors under certain
unbalanced situations.
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Nov 6, 2025
@ehuss ehuss enabled auto-merge November 6, 2025 02:55
@ehuss ehuss added this pull request to the merge queue Nov 6, 2025
Merged via the queue into rust-lang:master with commit 7d15668 Nov 6, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label Nov 6, 2025
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.

2 participants