Unnamed repository; edit this file 'description' to name the repository.
add support for tree-sitter custom template languages on vue (#13511)
Co-authored-by: TheSylex <[email protected]>
| -rw-r--r-- | runtime/queries/vue/injections.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/queries/vue/injections.scm b/runtime/queries/vue/injections.scm index 1b053e74..e57e1e5c 100644 --- a/runtime/queries/vue/injections.scm +++ b/runtime/queries/vue/injections.scm @@ -40,5 +40,21 @@ (raw_text) @injection.content) (#eq? @_attr_name "lang")) +; <template> +((template_element + (start_tag) @_no_lang + (text) @injection.content) + (#not-match? @_no_lang "lang=") + (#set! injection.language "html")) + +; <template lang="..."> +((template_element + (start_tag + (attribute + (attribute_name) @_attr_name + (quoted_attribute_value (attribute_value) @injection.language))) + (text) @injection.content) + (#eq? @_attr_name "lang")) + ((comment) @injection.content (#set! injection.language "comment")) |