Skip to content

Verbatim parsing #1083

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

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Verbatim parsing #1083

wants to merge 14 commits into from

Conversation

MoustaphaDev
Copy link
Member

No description provided.

This commit introduces the foundations for a more precise HTML parsing mode that preserves the original document structure more faithfully, as much as possible, and instead let the browser fix invalid HTML itself.
This commit makes the previously implemented exact HTML parsing mode an opt-in experimental feature rather than the default parsing mode. The new implementation:

1. Adds an `experimentalExactParsingThingy` flag to control whether to use the more precise HTML parsing mode.
   Will use a more formal name once we think it through
2. Reverts the default insertion mode from `initialIMExact` back to `initialIM`
3. Updates all WASM bindings to pass the experimental flag through to the parser
4. Adds extensive test coverage with duplicated previously failing test cases that verify the behavior with exact parsing enabled

The exact parsing mode preserves the original HTML document structure more faithfully, allowing invalid HTML to pass through to the browser rather than having the parser attempt to normalize it.

(Commit written with the assistance of AI)
Copy link

changeset-bot bot commented Jun 10, 2025

⚠️ No Changeset found

Latest commit: f1dbced

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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