2025-10-24 18:47:39 -07:00
|
|
|
; inherits: html_tags
|
|
|
|
|
|
2023-01-02 02:38:54 +09:00
|
|
|
; <script lang="css">
|
2023-03-24 23:38:19 +09:00
|
|
|
((style_element
|
2024-01-06 15:05:50 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(attribute_name) @_lang
|
|
|
|
|
(quoted_attribute_value
|
|
|
|
|
(attribute_value) @injection.language)))
|
|
|
|
|
(raw_text) @injection.content)
|
|
|
|
|
(#eq? @_lang "lang")
|
|
|
|
|
(#any-of? @injection.language "css" "scss"))
|
2022-12-17 12:27:14 +09:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
; TODO: When nvim-treesitter has postcss and less parsers, use @injection.language and @injection.content instead
|
2023-01-02 02:38:54 +09:00
|
|
|
; <script lang="scss">
|
2024-01-21 22:05:44 +09:00
|
|
|
(style_element
|
2024-01-06 15:05:50 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(attribute_name) @_lang
|
|
|
|
|
(quoted_attribute_value
|
|
|
|
|
(attribute_value) @_scss)))
|
|
|
|
|
(raw_text) @injection.content
|
|
|
|
|
(#eq? @_lang "lang")
|
2024-04-29 07:39:02 +03:00
|
|
|
(#any-of? @_scss "less" "postcss" "sass")
|
2024-01-21 22:05:44 +09:00
|
|
|
(#set! injection.language "scss"))
|
2023-05-03 19:07:59 +09:00
|
|
|
|
2023-01-02 02:38:54 +09:00
|
|
|
; <script lang="js">
|
2023-03-24 23:38:19 +09:00
|
|
|
((script_element
|
2024-01-06 15:05:50 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(attribute_name) @_lang
|
|
|
|
|
(quoted_attribute_value
|
|
|
|
|
(attribute_value) @_js)))
|
|
|
|
|
(raw_text) @injection.content)
|
|
|
|
|
(#eq? @_lang "lang")
|
|
|
|
|
(#eq? @_js "js")
|
|
|
|
|
(#set! injection.language "javascript"))
|
2021-02-08 18:48:14 +01:00
|
|
|
|
2023-01-02 02:38:54 +09:00
|
|
|
; <script lang="ts">
|
2023-03-24 23:38:19 +09:00
|
|
|
((script_element
|
2024-01-06 15:05:50 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(attribute_name) @_lang
|
|
|
|
|
(quoted_attribute_value
|
|
|
|
|
(attribute_value) @_ts)))
|
|
|
|
|
(raw_text) @injection.content)
|
|
|
|
|
(#eq? @_lang "lang")
|
|
|
|
|
(#eq? @_ts "ts")
|
|
|
|
|
(#set! injection.language "typescript"))
|
2023-03-24 23:38:19 +09:00
|
|
|
|
|
|
|
|
; <script lang="tsx">
|
|
|
|
|
; <script lang="jsx">
|
2024-01-21 22:05:44 +09:00
|
|
|
(script_element
|
2024-01-06 15:05:50 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(attribute_name) @_attr
|
|
|
|
|
(quoted_attribute_value
|
|
|
|
|
(attribute_value) @injection.language)))
|
|
|
|
|
(#eq? @_attr "lang")
|
|
|
|
|
(#any-of? @injection.language "tsx" "jsx")
|
2024-01-21 22:05:44 +09:00
|
|
|
(raw_text) @injection.content)
|
2021-02-08 18:48:14 +01:00
|
|
|
|
|
|
|
|
((interpolation
|
2023-05-03 19:07:59 +09:00
|
|
|
(raw_text) @injection.content)
|
2023-11-06 11:04:13 +09:00
|
|
|
(#set! injection.language "typescript"))
|
2021-03-12 11:21:46 -05:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
(directive_attribute
|
|
|
|
|
(quoted_attribute_value
|
|
|
|
|
(attribute_value) @injection.content
|
2023-11-06 11:04:13 +09:00
|
|
|
(#set! injection.language "typescript")))
|
2021-04-22 18:52:20 +02:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
(template_element
|
2024-01-06 15:05:50 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(quoted_attribute_value
|
|
|
|
|
(attribute_value) @injection.language)))
|
|
|
|
|
(text) @injection.content
|
|
|
|
|
(#eq? @injection.language "pug"))
|