mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
injections(html): event attributes (#4750)
injections(html): inject javascript into event attributes Adds javascript injections to HTML `onevent` attributes.
This commit is contained in:
parent
1e9e1492ee
commit
5e95ecaad0
1 changed files with 7 additions and 0 deletions
|
|
@ -66,3 +66,10 @@
|
||||||
(attribute_value) @regex
|
(attribute_value) @regex
|
||||||
] (#eq? @_attr "pattern")))
|
] (#eq? @_attr "pattern")))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
; <input type="checkbox" onchange="this.closest('form').elements.output.value = this.checked">
|
||||||
|
(attribute
|
||||||
|
(attribute_name) @_name
|
||||||
|
(#lua-match? @_name "^on[a-z]+$")
|
||||||
|
(#offset! @javascript 0 1 0 -1)
|
||||||
|
(quoted_attribute_value) @javascript)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue