Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: doctype with entities handling #272

Closed
wants to merge 1 commit into from
Closed

fix: doctype with entities handling #272

wants to merge 1 commit into from

Conversation

SethFalco
Copy link
Contributor

@SethFalco SethFalco commented May 27, 2024

While fixing comments in DTDs I introduced an issue by mistake where the ondoctype event would no longer fire for DOCTYPEs anymore.

  1. While the state is DOCTYPE_DTD, append the current character if we're not changing state.
  2. While the state is SGML_DECL, if we've established it's not a comment, and we know we're in a DOCTYPE declaration, change the state back to DOCTYPE_DTD and add the characters encountered so far.

This retains the ability to handle comments, but brings back the handling/event for DOCTYPEs declaration like entities.

I've added more tests for DOCTYPE declarations to make sure this isn't missed in future.

Related

@isaacs isaacs closed this in 968b53c May 27, 2024
@SethFalco SethFalco deleted the fix/doctype-entities branch May 27, 2024 23:47
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.

1 participant