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

Parsing of incomplete html doesn't catch a closing tag without an opening. #149

Open
hahn-kev opened this issue Dec 18, 2022 · 0 comments
Open

Comments

@hahn-kev
Copy link
Contributor

I'm currently using the language service for doing some validation of xml, specifically for invalid xml like the following:

  • <badTag>event-1 missing an end tag
  • <badTag>event-1</badTag end tag missing a closing '>'
  • <badTag/ self closing tag missing a closing '>'

these all work just fine right now, I can use LanguageService.parseHTMLDocument and it'll return a document where those nodes have been parsed and I can then check them to see if they're missing something.

However one case doesn't get returned as a node from the parse function and that's this

  • bagTag> content </badTag> the first tag is missing it's opening '<', but also there's a closing tag without an opening tag.

is this something that could be fixed? is there another way I should go about validating this html with the language service? I'm using the parsed document for doing a lot of other analysis of the xml so I don't want to just use the scanner as that would be a fair bit of duplicate work, but I'm not sure how else I would go about catching this corner case.

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

No branches or pull requests

1 participant