2023-01-02 02:38:54 +09:00
|
|
|
; inherits html_tags
|
2022-12-24 01:59:30 +09:00
|
|
|
|
2023-01-02 02:38:54 +09:00
|
|
|
; <script lang="css">
|
2023-03-24 23:38:19 +09:00
|
|
|
((style_element
|
2022-12-24 01:59:30 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(attribute_name) @_lang
|
2023-05-03 19:07:59 +09:00
|
|
|
(quoted_attribute_value (attribute_value) @injection.language)))
|
|
|
|
|
(raw_text) @injection.content)
|
2023-03-24 23:38:19 +09:00
|
|
|
(#eq? @_lang "lang")
|
2023-09-12 15:36:50 +09:00
|
|
|
(#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">
|
2023-03-24 23:38:19 +09:00
|
|
|
((style_element
|
2022-12-24 01:59:30 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
2023-01-02 02:38:54 +09:00
|
|
|
(attribute_name) @_lang
|
|
|
|
|
(quoted_attribute_value (attribute_value) @_scss)))
|
2023-05-03 19:07:59 +09:00
|
|
|
(raw_text) @injection.content
|
2023-03-24 23:38:19 +09:00
|
|
|
(#eq? @_lang "lang")
|
2023-05-03 19:07:59 +09:00
|
|
|
(#any-of? @_scss "less" "postcss")
|
2023-09-12 15:36:50 +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
|
2022-12-17 12:27:14 +09:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
2022-12-24 01:59:30 +09:00
|
|
|
(attribute_name) @_lang
|
|
|
|
|
(quoted_attribute_value (attribute_value) @_js)))
|
2023-05-03 19:07:59 +09:00
|
|
|
(raw_text) @injection.content)
|
2023-03-24 23:38:19 +09:00
|
|
|
(#eq? @_lang "lang")
|
|
|
|
|
(#eq? @_js "js")
|
2023-09-12 15:36:50 +09:00
|
|
|
(#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
|
2021-02-08 18:48:14 +01:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
2022-12-24 01:59:30 +09:00
|
|
|
(attribute_name) @_lang
|
|
|
|
|
(quoted_attribute_value (attribute_value) @_ts)))
|
2023-05-03 19:07:59 +09:00
|
|
|
(raw_text) @injection.content)
|
2023-03-24 23:38:19 +09:00
|
|
|
(#eq? @_lang "lang")
|
|
|
|
|
(#eq? @_ts "ts")
|
2023-09-12 15:36:50 +09:00
|
|
|
(#set! injection.language "typescript"))
|
2023-03-24 23:38:19 +09:00
|
|
|
|
|
|
|
|
; <script lang="tsx">
|
|
|
|
|
; <script lang="jsx">
|
|
|
|
|
((script_element
|
|
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
|
|
|
|
(attribute_name) @_attr
|
2023-05-03 19:07:59 +09:00
|
|
|
(quoted_attribute_value (attribute_value) @injection.language)))
|
2023-03-24 23:38:19 +09:00
|
|
|
(#eq? @_attr "lang")
|
2023-05-03 19:07:59 +09:00
|
|
|
(#any-of? @injection.language "tsx" "jsx")
|
2023-09-12 15:36:50 +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-09-12 15:36:50 +09:00
|
|
|
(#set! injection.language "javascript"))
|
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-09-12 15:36:50 +09:00
|
|
|
(#set! injection.language "javascript")))
|
2021-04-22 18:52:20 +02:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
(template_element
|
2021-07-10 17:36:49 +02:00
|
|
|
(start_tag
|
|
|
|
|
(attribute
|
2023-05-03 19:07:59 +09:00
|
|
|
(quoted_attribute_value (attribute_value) @injection.language)))
|
|
|
|
|
(text) @injection.content
|
2023-09-12 15:36:50 +09:00
|
|
|
(#eq? @injection.language "pug"))
|