diff options
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/html_tags/injections.scm | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/queries/html_tags/injections.scm b/queries/html_tags/injections.scm index c29619281..5f0719c64 100644 --- a/queries/html_tags/injections.scm +++ b/queries/html_tags/injections.scm @@ -1,22 +1,12 @@ ; <style>...</style> -( - (style_element - (start_tag - (tag_name) .) - (raw_text) @css) -) - ; <style blocking> ...</style> ; Add "lang" to predicate check so that vue/svelte can inherit this ; without having this element being captured twice ( (style_element - (start_tag - (attribute - (attribute_name) @_no_set_type)) - (raw_text) @css) - (#not-any-of? @_no_set_type "type" "lang") -) + (start_tag) @_no_type_lang + (#not-match? @_no_type_lang "\\s(lang|type)\\s*\\=") + (raw_text) @css)) ( (style_element @@ -30,22 +20,12 @@ ) ; <script>...</script> -( - (script_element - (start_tag - (tag_name) .) - (raw_text) @javascript) -) - ; <script defer>...</script> ( (script_element - (start_tag - (attribute - (attribute_name) @_no_set_type)) - (raw_text) @javascript) - (#not-any-of? @_no_set_type "type" "lang") -) + (start_tag) @_no_type_lang + (#not-match? @_no_type_lang "\\s(lang|type)\\s*\\=") + (raw_text) @javascript)) ( (script_element @@ -55,7 +35,7 @@ (quoted_attribute_value (attribute_value) @_javascript))) (raw_text) @javascript) (#eq? @_type "type") - (#eq? @_javascript "text/javascript") + (#any-of? @_javascript "text/javascript" "module") ) ((attribute |
