mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Since 0.9, @lang syntax is still available as fallback but will soon be deprecated. Because of that, new syntax should be adopted once 0.9 becomes the baseline requirements for nvim-treesitter - update health check - update doc
30 lines
786 B
Scheme
30 lines
786 B
Scheme
; inherits html_tags
|
|
|
|
(element
|
|
(start_tag
|
|
(tag_name) @_py_script)
|
|
(text) @injection.content
|
|
(#any-of? @_py_script "py-script" "py-repl")
|
|
(#set! injection.language "python")
|
|
(#set! injection.include-children))
|
|
|
|
(script_element
|
|
(start_tag
|
|
(attribute
|
|
(attribute_name) @_attr
|
|
(quoted_attribute_value
|
|
(attribute_value) @_type)))
|
|
(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")
|
|
(#set! injection.language "python")
|
|
(#set! injection.include-children))
|
|
|
|
(element
|
|
(start_tag
|
|
(tag_name) @_py_config)
|
|
(text) @injection.content
|
|
(#eq? @_py_config "py-config")
|
|
(#set! injection.language "toml")
|
|
(#set! injection.include-children))
|