diff options
| author | Benny Powers <bennypowers@users.noreply.github.com> | 2023-03-19 14:32:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-19 08:32:42 -0400 |
| commit | 4536156f32b8ab0aab264e3cd7819fc8e3daede4 (patch) | |
| tree | eda2a9266e9335babeb0f17ff7cf719ff0c165e3 | |
| parent | fix: svg injection in ecma tagged literals (diff) | |
| download | nvim-treesitter-4536156f32b8ab0aab264e3cd7819fc8e3daede4.tar nvim-treesitter-4536156f32b8ab0aab264e3cd7819fc8e3daede4.tar.gz nvim-treesitter-4536156f32b8ab0aab264e3cd7819fc8e3daede4.tar.bz2 nvim-treesitter-4536156f32b8ab0aab264e3cd7819fc8e3daede4.tar.lz nvim-treesitter-4536156f32b8ab0aab264e3cd7819fc8e3daede4.tar.xz nvim-treesitter-4536156f32b8ab0aab264e3cd7819fc8e3daede4.tar.zst nvim-treesitter-4536156f32b8ab0aab264e3cd7819fc8e3daede4.zip | |
injections(html): input regex patterns (#4521)
* injections(html): input regex patterns
replaces regex part of #2577
| -rw-r--r-- | queries/html_tags/injections.scm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/queries/html_tags/injections.scm b/queries/html_tags/injections.scm index 5f0719c64..23b500590 100644 --- a/queries/html_tags/injections.scm +++ b/queries/html_tags/injections.scm @@ -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"))) +)) |
