Skip to content

Fail parsing on HTML syntax error#6

Open
mfillon wants to merge 2 commits into
sgruendel:mainfrom
mfillon:parse-html-error
Open

Fail parsing on HTML syntax error#6
mfillon wants to merge 2 commits into
sgruendel:mainfrom
mfillon:parse-html-error

Conversation

@mfillon
Copy link
Copy Markdown

@mfillon mfillon commented May 21, 2026

Fixes part of #5

Only make parsing fail for now

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces HTML validation to the parser by integrating the angular-html-parser library. The parse function now validates the generated content and throws a SyntaxError with precise location data if any HTML structural issues are found. Additionally, unit tests have been added to cover invalid nesting and malformed tags. A review comment suggests ensuring that the column index for the end of the error location is 1-indexed to maintain consistency with the start column and meet Prettier's expectations.

Comment thread src/parser.ts Outdated
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