Skip to content

Commit bb1a7a0

Browse files
author
thom
committed
Fixed self-embedding.
1 parent d2ee76d commit bb1a7a0

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

Vue Component.sublime-syntax

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ contexts:
4444

4545
main:
4646
- include: template-tag
47+
- include: mustache-expression
4748

4849
- match: (<\?)(xml)
4950
captures:
@@ -637,6 +638,14 @@ contexts:
637638
- include: tag-style-attribute
638639
- include: tag-event-attribute
639640
- include: tag-generic-attribute
641+
mustache-expression:
642+
- match: '{{'
643+
scope: punctuation.definition.template.begin.html
644+
embed: scope:source.js
645+
escape: '}}'
646+
escape_captures:
647+
0: punctuation.definition.template.end.html
648+
640649
template-tag:
641650
- match: (<)((?i:template))\b
642651
captures:
@@ -853,17 +862,7 @@ contexts:
853862
set:
854863
- include: template-close-tag
855864
- match: ''
856-
push: scope:text.html.basic
857-
with_prototype:
858-
- match: (?=</template)
859-
pop: true
860-
- match: '{{'
861-
scope: punctuation.definition.template.begin.html
862-
embed: scope:source.js
863-
escape: '}}|(?=</template)'
864-
escape_captures:
865-
0: punctuation.definition.template.end.html
866-
865+
push: main
867866

868867
template-lang-attribute:
869868
- match: (?i)\blang\b

Vue Component.sublime-syntax.yaml-macros

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ file_extensions: [vue]
1111
contexts: !merge
1212
main: !prepend
1313
- include: template-tag
14+
- include: mustache-expression
15+
16+
mustache-expression:
17+
- match: '{{'
18+
scope: punctuation.definition.template.begin.html
19+
embed: scope:source.js
20+
escape: '}}'
21+
escape_captures:
22+
0: punctuation.definition.template.end.html
1423

1524
tag-attributes: !prepend
1625
- include: vue-directive
@@ -133,17 +142,7 @@ contexts: !merge
133142
set:
134143
- include: template-close-tag
135144
- match: ''
136-
push: scope:text.html.basic
137-
with_prototype:
138-
- match: (?=</template)
139-
pop: true
140-
- match: '{{'
141-
scope: punctuation.definition.template.begin.html
142-
embed: scope:source.js
143-
escape: '}}|(?=</template)'
144-
escape_captures:
145-
0: punctuation.definition.template.end.html
146-
145+
push: main
147146

148147
template-lang-attribute:
149148
- match: (?i)\blang\b

macros.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def embed_language_in_tag(tag, match, embed):
2323
set=[
2424
_rule(include='%s-close-tag' % tag),
2525
_rule(
26-
match=r'(?=\S)',
26+
match=r'',
2727
embed=('scope:%s' % embed),
2828
embed_scope=('%s.embedded.html' % embed),
2929
escape=r'(?i)(?=(?:-->\s*)?</%s)' % tag,

0 commit comments

Comments
 (0)