Himujjal / tree-sitter-svelte

Tree sitter grammar for Svelte
MIT License
77 stars 15 forks source link

Attribute value inaccurately highighted as plain string instead of an expression. #44

Open thenbe opened 7 months ago

thenbe commented 7 months ago

Expected

Given the following code snippet, both hrefs should be highlighted as expressions.

<script>
    const id = '123';
</script>

<a href="/todos/{id}"> first </a>

<a href={`/todos/${id}`}> second </a>

Actual

Only the second href is properly highlighted as an expression. The first href is inaccurately highlighted as a plain string.

Inspector view

first href (NOT OK)

2023-11-20-06-59-19

second href (OK)

2023-11-20-06-59-28