diff options
Diffstat (limited to 'queries/html')
| -rw-r--r-- | queries/html/injections.scm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/queries/html/injections.scm b/queries/html/injections.scm index 23981018c..eba8395a4 100644 --- a/queries/html/injections.scm +++ b/queries/html/injections.scm @@ -3,8 +3,10 @@ (element (start_tag (tag_name) @_py_script) - (text) @python - (#any-of? @_py_script "py-script" "py-repl")) + (text) @injection.content + (#any-of? @_py_script "py-script" "py-repl") + (#set! injection.language "python") + (#set! injection.include-children)) (script_element (start_tag @@ -12,13 +14,17 @@ (attribute_name) @_attr (quoted_attribute_value (attribute_value) @_type))) - (raw_text) @python + (raw_text) @injection.content (#eq? @_attr "type") ; not adding type="py" here as it's handled by html_tags - (#any-of? @_type "pyscript" "py-script")) + (#any-of? @_type "pyscript" "py-script") + (#set! injection.language "python") + (#set! injection.include-children)) (element (start_tag (tag_name) @_py_config) - (text) @toml - (#eq? @_py_config "py-config")) + (text) @injection.content + (#eq? @_py_config "py-config") + (#set! injection.language "toml") + (#set! injection.include-children)) |
