refactor(html_inject): use lua-match where possible

This commit is contained in:
Pham Huy Hoang 2023-04-09 15:05:04 +09:00 committed by Amaan Qureshi
parent cc360a9beb
commit a82501244a

View file

@ -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