Skip to content

Fail parsing on HTML syntax error#6

Merged
sgruendel merged 3 commits into
sgruendel:mainfrom
mfillon:parse-html-error
May 26, 2026
Merged

Fail parsing on HTML syntax error#6
sgruendel merged 3 commits into
sgruendel:mainfrom
mfillon:parse-html-error

Conversation

@mfillon
Copy link
Copy Markdown
Contributor

@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
@mfillon
Copy link
Copy Markdown
Contributor Author

mfillon commented May 26, 2026

Ping @sgruendel
(Not sure if you got notified for this PR)

@sgruendel
Copy link
Copy Markdown
Owner

Ping @sgruendel (Not sure if you got notified for this PR)

ah yes hadn't set up notifications properly I guess, looking at it now

@sgruendel sgruendel merged commit 36766ca into sgruendel:main May 26, 2026
1 check passed
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