Skip to content

Conversation

@nnabeyang
Copy link
Contributor

This pull request refactors the HtmlTokenizer to always set self.reconsume = true at the beginning of two states:

  • BeforeAttributeName
  • ScriptDataEndTagOpen

In both cases, the flag was previously set conditionally in multiple branches, but always ended up being set regardless of the input.

This change does not affect behavior and serves purely as a cleanup aligned with the structure of the HTML parsing algorithm.

@d0iasm
Copy link
Owner

d0iasm commented May 28, 2025

I'd like to keep the current code because it exactly matches the HTML spec.
if we add additional conditions in the future, having self.reconsume = true at the beginning would be wrong. (Although I haven't checked the spec yet)

@nnabeyang
Copy link
Contributor Author

@d0iasm Got it. Thank you for reviewing.

@nnabeyang nnabeyang closed this May 28, 2025
@nnabeyang nnabeyang deleted the refactor-html-tokenizer-reconsume branch May 28, 2025 23:01
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