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(parser): Keep html and body end locations #436

Merged
merged 2 commits into from
Mar 7, 2022
Merged

fix(parser): Keep html and body end locations #436

merged 2 commits into from
Mar 7, 2022

Conversation

fb55
Copy link
Collaborator

@fb55 fb55 commented Mar 5, 2022

Currently, we override the end locations for html and body tags on EOF. body will now take the end position from a closing html tag, if there was no closing body tag.

This isn't the most elegant solution, so happy for any suggestions of how to improve things.

Currently, we override the end locations for `html` and `body` tags on EOF.

This isn't the most elegant solution, so happy for any suggestions of how to improve things.
@fb55 fb55 enabled auto-merge (squash) March 7, 2022 11:02
@fb55 fb55 merged commit 1525329 into master Mar 7, 2022
fb55 added a commit that referenced this pull request Mar 7, 2022
For some reason, we were escaping the data before. That meant we would only assert once that the received string matched the input.

Now, we properly walk the tree (depth first, from the deepest node), and test nodes along the way.

Requires #436
@fb55 fb55 deleted the fix/root-locs branch March 8, 2022 11:01
jmbpwtw pushed a commit to jmbpwtw/parse5 that referenced this pull request Feb 16, 2023
Before, we overrode the end locations for `html` and `body` tags on EOF. `body` will now take the end position from a closing `html` tag, if there was no closing `body` tag.
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