mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -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
|
||||
(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))
|
||||
|
||||
; <script type="mimetype-or-well-known-script-type">
|
||||
|
|
@ -47,11 +48,11 @@
|
|||
; <a @click="${e => console.log(e)}">
|
||||
((attribute
|
||||
(quoted_attribute_value (attribute_value) @javascript))
|
||||
(#match? @javascript "\\$\\{")
|
||||
(#lua-match? @javascript "%${")
|
||||
(#offset! @javascript 0 2 0 -1))
|
||||
((attribute
|
||||
(attribute_value) @javascript)
|
||||
(#match? @javascript "\\$\\{")
|
||||
(#lua-match? @javascript "%${")
|
||||
(#offset! @javascript 0 2 0 -2))
|
||||
|
||||
(comment) @comment
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue