mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
fix(ecma): template literal injections
see e3ebc8ec5d (commitcomment-104824257) for explanation
This also assigns the HTML parser for SVG tagged literals, since svg uses the HTML parser
This commit is contained in:
parent
6a269f197e
commit
1ba94e9f01
1 changed files with 13 additions and 0 deletions
|
|
@ -11,6 +11,19 @@
|
||||||
(#offset! @content 0 1 0 -1))
|
(#offset! @content 0 1 0 -1))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
; html`...`, sql`...` etc
|
||||||
|
(call_expression
|
||||||
|
function: ((identifier) @language)
|
||||||
|
arguments: ((template_string) @content
|
||||||
|
(#offset! @content 0 1 0 -1))
|
||||||
|
)
|
||||||
|
|
||||||
|
; svg`...`, which uses the html parser
|
||||||
|
(call_expression
|
||||||
|
function: ((identifier) @_name (#eq? @_name "svg"))
|
||||||
|
arguments: ((template_string) @html
|
||||||
|
(#offset! @html 0 1 0 -1)))
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
function: ((identifier) @_name
|
function: ((identifier) @_name
|
||||||
(#eq? @_name "gql"))
|
(#eq? @_name "gql"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue