Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit f157cc7

Browse files
committed
Merge pull request #51 from herophuong/patch-1
Support highlighting inside script[type=ng-template]
2 parents 736dc45 + b760260 commit f157cc7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

grammars/angularjs.cson

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,38 @@
8484
{ 'include': '#tag-stuff' }
8585
]
8686
}
87+
{
88+
'begin': '(?:^\\s+)?(<)((?i:script))\\b(?=[^>]*\\btype\\s*=\\s*[\'"]?text/ng-template[\'"]?)(?![^>]*/>)'
89+
'beginCaptures':
90+
'1':
91+
'name': 'punctuation.definition.tag.html'
92+
'2':
93+
'name': 'entity.name.tag.script.html'
94+
'end': '(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?'
95+
'endCaptures':
96+
'2':
97+
'name': 'punctuation.definition.tag.html'
98+
'contentName': 'text.embedded.html'
99+
'patterns': [
100+
{
101+
'include': '#tag-stuff'
102+
}
103+
{
104+
'begin': '(?<!</(?:script|SCRIPT))(>)'
105+
'captures':
106+
'1':
107+
'name': 'punctuation.definition.tag.html'
108+
'2':
109+
'name': 'entity.name.tag.script.html'
110+
'end': '(</)((?i:script))'
111+
'patterns': [
112+
{
113+
'include': 'text.html.angular'
114+
}
115+
]
116+
}
117+
]
118+
}
87119
{ 'include': '#angular-expressions' }
88120
{ 'include': 'text.html.basic' }
89121
]

0 commit comments

Comments
 (0)