Skip to content

Commit bcff768

Browse files
authored
[HTML] Add support for 'text/babel' MIME type (#3652)
This commit adds `text/babel` to the list of supported MIME types to enable JavaScript highlighting within <script type="text/babel"> tags. see: vuejs/vue-syntax-highlight#218
1 parent 80371bb commit bcff768

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

HTML/HTML.sublime-syntax

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ variables:
4040
javascript_mime_type: |-
4141
(?xi:
4242
(?:
43+
# default JS MIME types
4344
# https://mimesniff.spec.whatwg.org/#javascript-mime-type
4445
(?:application|text)/(?:x-)?(?:java|ecma)script
4546
| text/javascript1\.[0-5]
4647
| text/jscript
4748
| text/livescript
49+
# non-standard JS MIME types
50+
| text/babel
4851
)
4952
{{mime_type_parameters}}?
5053
)

HTML/syntax_test_html.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@
9292
## ^^^^^^^^^ meta.tag.script.end.html - source.js.embedded.html
9393
## ^ - meta.tag
9494

95+
<script type="text/babel">var foo</script>
96+
## ^^^^^^^^^^^^^^^^^^^^^^^ meta.tag.script.begin.html
97+
## ^^^^^^^ source.js.embedded.html
98+
## ^^^^^^^^^ meta.tag.script.end.html
99+
95100
<script type="text/javascript"> <!--
96101
##^^^^^^ meta.tag.script.begin.html - meta.tag meta.tag - meta.attribute-with-value - source
97102
## ^^^^^^^^^^^^^^^^^^^^^^ meta.tag.script.begin.html meta.attribute-with-value.html - meta.tag meta.tag - meta.attribute-with-value meta.attribute-with-value - source

0 commit comments

Comments
 (0)