tree-sitter / tree-sitter-html

HTML grammar for Tree-sitter
MIT License
136 stars 72 forks source link

Fix comment end bug #4

Closed Aerijo closed 6 years ago

Aerijo commented 6 years ago

HTML comments (to my knowledge) can only end with -->. Currently, the dash count is not reset when a > is seen, so the parser will accept ->-> as closing the comment (this can be seen in Atom).

The change removes the break keyword, so it will continue into the default behaviour and reset the dash count. I considered adding dashes = 0 above instead, but removing break felt cleaner.

Also added tests to prevent regressions.

maxbrunsfeld commented 6 years ago

Awesome, thanks so much for fixing that!