@@ -13,7 +13,6 @@ contexts:
13
13
- match : " -->"
14
14
scope : punctuation.definition.comment.begin.html
15
15
pop : true
16
-
17
16
- include : template_langs
18
17
- match : ' (<)(template).*(>)'
19
18
captures :
@@ -28,26 +27,11 @@ contexts:
28
27
2 : entity.name.tag.custom.html
29
28
3 : punctuation.definition.tag.begin.html
30
29
pop : true
31
- - include : template_content
30
+ - include : template_embeds
32
31
- include : scripts
33
32
- include : styles
34
-
35
- template_langs :
36
- - match : (<)(template)\b[^>]*(lang)\s*=\s*([\'\"]pug[\'\"])\s*.*(>)
37
- captures :
38
- 1 : punctuation.definition.tag.begin.html
39
- 2 : entity.name.tag.script.html
40
- 3 : entity.other.attribute-name.html
41
- 4 : string.quoted.double.html
42
- 5 : meta.tag.script.end.html
43
- embed : scope:text.pug
44
- escape : (</)(template)(>)
45
- escape_captures :
46
- 1 : punctuation.definition.tag.begin.html
47
- 2 : entity.name.tag.script.html
48
- 3 : meta.tag.script.end.html
49
33
50
- template_content :
34
+ template_embeds :
51
35
- match : (?:^|\s+)(v-\S+|:\S+|@\S+)\b\s*(=)\s*(")\s*
52
36
captures :
53
37
1 : entity.other.attribute-name.event.html
@@ -58,38 +42,69 @@ contexts:
58
42
scope : punctuation.definition.string.end.html string.quoted.double.html
59
43
pop : true
60
44
- include : scope:source.js
61
- - match : ' {{'
62
- embed : ' scope:source.js'
63
- escape : ' }}'
45
+ - match : (?:^|\s+)(v-\S+|:\S+|@\S+)\b\s*(=)\s*(')\s*
46
+ captures :
47
+ 1 : entity.other.attribute-name.event.html
48
+ 2 : punctuation.separator.key-value.html
49
+ 3 : punctuation.definition.string.begin.html string.quoted.single.html
50
+ push :
51
+ - match : " '"
52
+ scope : punctuation.definition.string.end.html string.quoted.single.html
53
+ pop : true
54
+ - include : scope:source.js
55
+ - match : ' ({{)'
56
+ push :
57
+ - match : ' (}})'
58
+ pop : true
59
+ - include : scope:source.js
64
60
65
- scripts :
66
- - match : (<)(script )\b[^>]*(lang)\s*=\s*([\'\"]coffee [\'\"])\s*.*(>)
61
+ template_langs :
62
+ - match : (<)(template )\b[^>]*(lang)\s*=\s*([\'\"]pug [\'\"])\s*.*(>)
67
63
captures :
68
64
1 : punctuation.definition.tag.begin.html
69
65
2 : entity.name.tag.script.html
70
66
3 : entity.other.attribute-name.html
71
67
4 : string.quoted.double.html
72
68
5 : meta.tag.script.end.html
73
- embed : scope:source.coffee
74
- escape : (</)(script)(>)
75
- escape_captures :
76
- 1 : punctuation.definition.tag.begin.html
77
- 2 : entity.name.tag.script.html
78
- 3 : meta.tag.script.end.html
79
- # If no lang is set, fall back to js
80
- - match : (<)(script).*(>)
69
+ push :
70
+ - match : (</)(template)(>)
71
+ captures :
72
+ 1 : punctuation.definition.tag.begin.html
73
+ 2 : entity.name.tag.style.html
74
+ 3 : punctuation.definition.tag.end.html
75
+ pop : true
76
+ - include : scope:text.pug
77
+
78
+
79
+ scripts :
80
+ - match : (<)(script)\b[^>]*(lang)\s*=\s*([\'\"]coffee[\'\"])\s*.*(>)
81
81
captures :
82
82
1 : punctuation.definition.tag.begin.html
83
83
2 : entity.name.tag.script.html
84
84
3 : entity.other.attribute-name.html
85
85
4 : string.quoted.double.html
86
86
5 : meta.tag.script.end.html
87
- embed : scope:source.js
88
- escape : (</)(script)(>)
89
- escape_captures :
87
+ push :
88
+ - match : (</)(script)(>)
89
+ pop : true
90
+ captures :
91
+ 1 : punctuation.definition.tag.begin.html
92
+ 2 : entity.name.tag.script.html
93
+ 3 : meta.tag.script.end.html
94
+ - include : scope:source.coffee
95
+ - match : (<)(script).*(>)
96
+ captures :
90
97
1 : punctuation.definition.tag.begin.html
91
98
2 : entity.name.tag.script.html
92
- 3 : meta.tag.script.end.html
99
+ 3 : punctuation.definition.tag.end.html
100
+ push :
101
+ - match : (</)(script)(>)
102
+ captures :
103
+ 1 : punctuation.definition.tag.begin.html
104
+ 2 : entity.name.tag.script.html
105
+ 3 : punctuation.definition.tag.end.html
106
+ pop : true
107
+ - include : scope:source.js
93
108
94
109
styles :
95
110
- match : (<)(style)\b[^>]*(lang)\s*=\s*([\'\"]stylus[\'\"])\s*.*(>)
@@ -99,49 +114,57 @@ contexts:
99
114
3 : entity.other.attribute-name.html
100
115
4 : string.quoted.double.html
101
116
5 : meta.tag.script.end.html
102
- embed : scope:source.stylus
103
- escape : (</)(style).*(>)
104
- escape_captures :
105
- 1 : punctuation.definition.tag.begin.html
106
- 2 : entity.name.tag.script.html
107
- 3 : meta.tag.script.end.html
117
+ push :
118
+ - match : (</)(style)(>)
119
+ captures :
120
+ 1 : punctuation.definition.tag.begin.html
121
+ 2 : entity.name.tag.style.html
122
+ 3 : punctuation.definition.tag.end.html
123
+ pop : true
124
+ - include : scope:source.stylus
125
+
108
126
- match : (<)(style)\b[^>]*(lang)\s*=\s*([\'\"]sass[\'\"])\s*.*(>)
109
127
captures :
110
128
1 : punctuation.definition.tag.begin.html
111
129
2 : entity.name.tag.script.html
112
130
3 : entity.other.attribute-name.html
113
131
4 : string.quoted.double.html
114
132
5 : meta.tag.script.end.html
115
- embed : scope:source.sass
116
- escape : (</)(style).*(>)
117
- escape_captures :
118
- 1 : punctuation.definition.tag.begin.html
119
- 2 : entity.name.tag.script.html
120
- 3 : meta.tag.script.end.html
133
+ push :
134
+ - match : (</)(style)(>)
135
+ captures :
136
+ 1 : punctuation.definition.tag.begin.html
137
+ 2 : entity.name.tag.style.html
138
+ 3 : punctuation.definition.tag.end.html
139
+ pop : true
140
+ - include : scope:source.sass
121
141
- match : (<)(style)\b[^>]*(lang)\s*=\s*([\'\"]scss[\'\"])\s*.*(>)
122
142
captures :
123
143
1 : punctuation.definition.tag.begin.html
124
144
2 : entity.name.tag.script.html
125
145
3 : entity.other.attribute-name.html
126
146
4 : string.quoted.double.html
127
147
5 : meta.tag.script.end.html
128
- embed : scope:source.scss
129
- escape : (</)(style).*(>)
130
- escape_captures :
131
- 1 : punctuation.definition.tag.begin.html
132
- 2 : entity.name.tag.script.html
133
- 3 : meta.tag.script.end.html
148
+ push :
149
+ - match : (</)(style)(>)
150
+ captures :
151
+ 1 : punctuation.definition.tag.begin.html
152
+ 2 : entity.name.tag.style.html
153
+ 3 : punctuation.definition.tag.end.html
154
+ pop : true
155
+ - include : scope:source.scss
156
+
134
157
- match : (<)(style).*(>)
135
158
captures :
136
159
1 : punctuation.definition.tag.begin.html
137
- 2 : entity.name.tag.script .html
138
- 3 : meta.tag.script .end.html
139
- embed : scope:source.css
140
- escape : (</)(style).* (>)
141
- escape_captures :
142
- 1 : punctuation.definition.tag.begin.html
143
- 2 : entity.name.tag.script .html
144
- 3 : meta.tag.script .end.html
145
-
146
-
160
+ 2 : entity.name.tag.style .html
161
+ 3 : punctuation.definition.tag .end.html
162
+ push :
163
+ - match : (</)(style)(>)
164
+ captures :
165
+ 1 : punctuation.definition.tag.begin.html
166
+ 2 : entity.name.tag.style .html
167
+ 3 : punctuation.definition.tag .end.html
168
+ pop : true
169
+ - include : scope:source.css
147
170
0 commit comments