vrischmann / tree-sitter-templ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`/` in markup text breaks highlighting and tree-sitter parse

andrewmthomas87 opened this issue · comments

/ in markup text breaks highlighting and tree-sitter parse.

Example:

package templates

templ OK(errors map[string]string) {
	<p>First or given name</p>
	if err, ok := errors["name-short"]; ok {
		<p style="color: red;">{ err }</p>
	}
}

templ Broken(errors map[string]string) {
	<p>First/given name</p>
	if err, ok := errors["name-short"]; ok {
		<p style="color: red;">{ err }</p>
	}
}

In Broken, the / in the text of the first p element appears to break things.

Screenshot 2024-01-16 at 4 16 40 PM

Output of tree-sitter-subtree:

Screenshot 2024-01-16 at 4 20 38 PM

I'm using Helix. I've manually updated the grammar to the most recent commit on master (c3baaab).

Hi,

thanks for reporting the issue. I'll look into it.