Allow custom preprocessors for 'vue' injections (#5268)

pull/5165/head
farwyler 2 years ago committed by GitHub
parent ebaf01924d
commit 1f4d277013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
(start_tag) @_no_lang
(raw_text) @injection.content) (raw_text) @injection.content)
(#not-match? @_no_lang "lang=")
(#set! injection.language "javascript")) (#set! injection.language "javascript"))
; <script lang="...">
((script_element
(start_tag
(attribute
(attribute_name) @_attr_name
(quoted_attribute_value (attribute_value) @injection.language)))
(raw_text) @injection.content)
(#eq? @_attr_name "lang"))
; <style>
((style_element ((style_element
(start_tag) @_no_lang
(raw_text) @injection.content) (raw_text) @injection.content)
(#not-match? @_no_lang "lang=")
(#set! injection.language "css")) (#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…
Cancel
Save