mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 07:50:07 -04:00
refactor(html_inject): use lua-match where possible
This commit is contained in:
parent
cc360a9beb
commit
a82501244a
1 changed files with 4 additions and 3 deletions
|
|
@ -25,7 +25,8 @@
|
||||||
(
|
(
|
||||||
(script_element
|
(script_element
|
||||||
(start_tag) @_no_type_lang
|
(start_tag) @_no_type_lang
|
||||||
(#not-match? @_no_type_lang "\\s(lang|type)\\s*\\=")
|
(#not-lua-match? @_no_type_lang "%slang%s*=")
|
||||||
|
(#not-lua-match? @_no_type_lang "%stype%s*=")
|
||||||
(raw_text) @javascript))
|
(raw_text) @javascript))
|
||||||
|
|
||||||
; <script type="mimetype-or-well-known-script-type">
|
; <script type="mimetype-or-well-known-script-type">
|
||||||
|
|
@ -47,11 +48,11 @@
|
||||||
; <a @click="${e => console.log(e)}">
|
; <a @click="${e => console.log(e)}">
|
||||||
((attribute
|
((attribute
|
||||||
(quoted_attribute_value (attribute_value) @javascript))
|
(quoted_attribute_value (attribute_value) @javascript))
|
||||||
(#match? @javascript "\\$\\{")
|
(#lua-match? @javascript "%${")
|
||||||
(#offset! @javascript 0 2 0 -1))
|
(#offset! @javascript 0 2 0 -1))
|
||||||
((attribute
|
((attribute
|
||||||
(attribute_value) @javascript)
|
(attribute_value) @javascript)
|
||||||
(#match? @javascript "\\$\\{")
|
(#lua-match? @javascript "%${")
|
||||||
(#offset! @javascript 0 2 0 -2))
|
(#offset! @javascript 0 2 0 -2))
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue