tree-sitter / tree-sitter-html

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

Don't skip leading whitespace in raw text elements #41

Closed kopecs closed 1 year ago

kopecs commented 2 years ago

Currently the external scanner code skips past leading whitespace when invoked. In the case of raw text elements this is contrary to the HTML standard: 1, 2. Therefore we should check if we're processing raw text, and only skip the whitespace if not.

I can't figure out a way to add a test which depends on the specific source range, but if this is possible I can also add some additional tests for this.

Closes #40.

amaanq commented 1 year ago

Needs a rebase, I'll just create a new pr