mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
fix(ecma): fix no injections for innerHTML (#5258)
This commit is contained in:
parent
64d1696d6d
commit
294f753ed3
1 changed files with 10 additions and 5 deletions
|
|
@ -100,6 +100,15 @@
|
||||||
(#set! injection.language "graphql"))
|
(#set! injection.language "graphql"))
|
||||||
|
|
||||||
; el.innerHTML = `<html>`
|
; el.innerHTML = `<html>`
|
||||||
|
(assignment_expression
|
||||||
|
left:
|
||||||
|
(member_expression
|
||||||
|
property: (property_identifier) @_prop
|
||||||
|
(#any-of? @_prop "outerHTML" "innerHTML"))
|
||||||
|
right: (template_string) @injection.content
|
||||||
|
(#offset! @injection.content 0 1 0 -1)
|
||||||
|
(#set! injection.language "html"))
|
||||||
|
|
||||||
; el.innerHTML = '<html>'
|
; el.innerHTML = '<html>'
|
||||||
(assignment_expression
|
(assignment_expression
|
||||||
left:
|
left:
|
||||||
|
|
@ -107,9 +116,5 @@
|
||||||
property: (property_identifier) @_prop
|
property: (property_identifier) @_prop
|
||||||
(#any-of? @_prop "outerHTML" "innerHTML"))
|
(#any-of? @_prop "outerHTML" "innerHTML"))
|
||||||
right:
|
right:
|
||||||
[
|
(string (string_fragment) @injection.content)
|
||||||
(template_string)
|
|
||||||
(string)
|
|
||||||
] @injection.content
|
|
||||||
(#offset! @injection.content 0 1 0 -1)
|
|
||||||
(#set! injection.language "html"))
|
(#set! injection.language "html"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue