Skip to content

Cleanup malformed doctype tokenisation - #2635

Merged
jhy merged 2 commits into
masterfrom
doctype-cleanup
Sep 29, 2026
Merged

jhy merged 2 commits into
masterfrom
doctype-cleanup

Conversation

@jhy

@jhy jhy commented Sep 29, 2026

Copy link
Copy Markdown
Owner

This better aligns to the spec, and removes duplicate tokens and errors when in bogus states.

The tokeniser now follows the specs's reconsume and bogus DOCTYPE transitions:

  • <!DOCTYPE >Hello puts Hello in the body, not the doctype
  • <!DOCTYPE html SYSTEMfoo>Hi emits one DOCTYPE instead of repeatedly emitting tokens.

Also removes duplicate EOF and valid-quote errors, and reports null characters in bogus DOCTYPEs.

This better aligns to the spec, and removes duplicate tokens and errors when in bogus states.
@jhy jhy added this to the 1.24.1 milestone Sep 29, 2026
@jhy jhy self-assigned this Sep 29, 2026
@jhy jhy added the bug A confirmed bug, that we should fix label Sep 29, 2026
@jhy jhy added the fixed An {bug|improvement} that has been {fixed|implemented} label Sep 29, 2026
@jhy
jhy merged commit 1aa1234 into master Sep 29, 2026
22 checks passed
@jhy
jhy deleted the doctype-cleanup branch September 29, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A confirmed bug, that we should fix fixed An {bug|improvement} that has been {fixed|implemented}

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant