mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
injections(html): input regex patterns (#4521)
* injections(html): input regex patterns replaces regex part of #2577
This commit is contained in:
parent
38f878a1cd
commit
4536156f32
1 changed files with 12 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
|||
; without having this element being captured twice
|
||||
(
|
||||
(style_element
|
||||
(start_tag) @_no_type_lang
|
||||
(start_tag) @_no_type_lang
|
||||
(#not-match? @_no_type_lang "\\s(lang|type)\\s*\\=")
|
||||
(raw_text) @css))
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
; <script defer>...</script>
|
||||
(
|
||||
(script_element
|
||||
(start_tag) @_no_type_lang
|
||||
(start_tag) @_no_type_lang
|
||||
(#not-match? @_no_type_lang "\\s(lang|type)\\s*\\=")
|
||||
(raw_text) @javascript))
|
||||
|
||||
|
|
@ -54,3 +54,13 @@
|
|||
(#offset! @javascript 0 2 0 -2))
|
||||
|
||||
(comment) @comment
|
||||
|
||||
; <input pattern="[0-9]"> or <input pattern=[0-9]>
|
||||
(element (_
|
||||
(tag_name) @_tagname (#eq? @_tagname "input")
|
||||
((attribute
|
||||
(attribute_name) @_attr [
|
||||
(quoted_attribute_value (attribute_value) @regex)
|
||||
(attribute_value) @regex
|
||||
] (#eq? @_attr "pattern")))
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue