injections(html): input regex patterns (#4521)

* injections(html): input regex patterns

replaces regex part of #2577
This commit is contained in:
Benny Powers 2023-03-19 14:32:42 +02:00 committed by GitHub
parent 38f878a1cd
commit 4536156f32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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