Allow custom preprocessors for 'vue' injections (#5268)
This commit is contained in:
parent
ebaf01924d
commit
1f4d277013
@ -8,13 +8,37 @@
|
||||
(raw_text) @injection.content)
|
||||
(#set! injection.language "javascript"))
|
||||
|
||||
; <script>
|
||||
((script_element
|
||||
(raw_text) @injection.content)
|
||||
(#set! injection.language "javascript"))
|
||||
(start_tag) @_no_lang
|
||||
(raw_text) @injection.content)
|
||||
(#not-match? @_no_lang "lang=")
|
||||
(#set! injection.language "javascript"))
|
||||
|
||||
((style_element
|
||||
; <script lang="...">
|
||||
((script_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_attr_name
|
||||
(quoted_attribute_value (attribute_value) @injection.language)))
|
||||
(raw_text) @injection.content)
|
||||
(#set! injection.language "css"))
|
||||
(#eq? @_attr_name "lang"))
|
||||
|
||||
; <style>
|
||||
((style_element
|
||||
(start_tag) @_no_lang
|
||||
(raw_text) @injection.content)
|
||||
(#not-match? @_no_lang "lang=")
|
||||
(#set! injection.language "css"))
|
||||
|
||||
; <style lang="...">
|
||||
((style_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_attr_name
|
||||
(quoted_attribute_value (attribute_value) @injection.language)))
|
||||
(raw_text) @injection.content)
|
||||
(#eq? @_attr_name "lang"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
Loading…
Reference in New Issue
Block a user