@@ -117,6 +117,11 @@ contexts:
117
117
- script-coffeescript
118
118
- tag-lang-attribute-meta
119
119
- tag-generic-attribute-value
120
+ - match : (?i)(?=jsx{{unquoted_attribute_break}}|'jsx'|"jsx")
121
+ set :
122
+ - script-jsx
123
+ - tag-lang-attribute-meta
124
+ - tag-generic-attribute-value
120
125
- match : (?i)(?=livescript{{unquoted_attribute_break}}|'livescript'|"livescript")
121
126
set :
122
127
- script-livescript
@@ -127,6 +132,11 @@ contexts:
127
132
- script-typescript
128
133
- tag-lang-attribute-meta
129
134
- tag-generic-attribute-value
135
+ - match : (?i)(?=tsx{{unquoted_attribute_break}}|'tsx'|"tsx")
136
+ set :
137
+ - script-tsx
138
+ - tag-lang-attribute-meta
139
+ - tag-generic-attribute-value
130
140
- match : (?=\S)
131
141
set :
132
142
- script-javascript
@@ -203,6 +213,29 @@ contexts:
203
213
3 : source.js.embedded.html
204
214
4 : comment.block.html punctuation.definition.comment.end.html
205
215
216
+ script-jsx :
217
+ - meta_include_prototype : false
218
+ - meta_scope : meta.tag.script.begin.html
219
+ - match : ' >'
220
+ scope : punctuation.definition.tag.end.html
221
+ set : script-jsx-content
222
+ - include : script-common
223
+
224
+ script-jsx-content :
225
+ - meta_include_prototype : false
226
+ - match : ' {{script_content_begin}}'
227
+ captures :
228
+ 1 : comment.block.html punctuation.definition.comment.begin.html
229
+ pop : 1 # make sure to match only once
230
+ embed : scope:source.jsx
231
+ embed_scope : source.jsx.embedded.html
232
+ escape : ' {{script_content_end}}'
233
+ escape_captures :
234
+ 1 : source.jsx.embedded.html
235
+ 2 : comment.block.html punctuation.definition.comment.end.html
236
+ 3 : source.jsx.embedded.html
237
+ 4 : comment.block.html punctuation.definition.comment.end.html
238
+
206
239
script-livescript :
207
240
- meta_include_prototype : false
208
241
- meta_scope : meta.tag.script.begin.html
@@ -226,6 +259,29 @@ contexts:
226
259
3 : source.livescript.embedded.html
227
260
4 : comment.block.html punctuation.definition.comment.end.html
228
261
262
+ script-tsx :
263
+ - meta_include_prototype : false
264
+ - meta_scope : meta.tag.script.begin.html
265
+ - match : ' >'
266
+ scope : punctuation.definition.tag.end.html
267
+ set : script-tsx-content
268
+ - include : script-common
269
+
270
+ script-tsx-content :
271
+ - meta_include_prototype : false
272
+ - match : ' {{script_content_begin}}'
273
+ captures :
274
+ 1 : comment.block.html punctuation.definition.comment.begin.html
275
+ pop : 1 # make sure to match only once
276
+ embed : scope:source.tsx
277
+ embed_scope : source.tsx.embedded.html
278
+ escape : ' {{script_content_end}}'
279
+ escape_captures :
280
+ 1 : source.tsx.embedded.html
281
+ 2 : comment.block.html punctuation.definition.comment.end.html
282
+ 3 : source.tsx.embedded.html
283
+ 4 : comment.block.html punctuation.definition.comment.end.html
284
+
229
285
script-typescript :
230
286
- meta_include_prototype : false
231
287
- meta_scope : meta.tag.script.begin.html
0 commit comments