Allow custom preprocessors for 'vue' injections (#5268)
This commit is contained in:
parent
ebaf01924d
commit
1f4d277013
1 changed files with 28 additions and 4 deletions
|
@ -8,13 +8,37 @@
|
||||||
(raw_text) @injection.content)
|
(raw_text) @injection.content)
|
||||||
(#set! injection.language "javascript"))
|
(#set! injection.language "javascript"))
|
||||||
|
|
||||||
|
; <script>
|
||||||
((script_element
|
((script_element
|
||||||
(raw_text) @injection.content)
|
(start_tag) @_no_lang
|
||||||
(#set! injection.language "javascript"))
|
(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)
|
(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
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue