Skip to content

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

@ascorbic
Copy link
Contributor

@MoustaphaDev what needs to be done to get this across the line?

@MoustaphaDev
Copy link
Member Author

Not much really, IIRC only fixing a regression that rendered the head in the wrong position and add tests to cover all issues caused by the current HTML correction behavior.

@MoustaphaDev
Copy link
Member Author

MoustaphaDev commented Aug 25, 2025

Btw I let this sit without an update for way too long—owning that. I’ll resume work by Thursday and plan to wrap within two weeks (if the RFC process follows smoothly). Remaining work is what I outlined above; I’ll post an update if anything changes and then take this out of draft.

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.

3 participants