@@ -82,6 +82,35 @@ describe 'directive grammar', ->
8282 expect (lines[0 ][1 ]).toEqual value : ' NG-INCLUDE' , scopes : [' text.html.angular' , ' meta.tag.block.any.html' , ' entity.name.tag.block.any.html.angular' ]
8383 expect (lines[0 ][5 ]).toEqual value : ' NG-INCLUDE' , scopes : [' text.html.angular' , ' meta.tag.block.any.html' , ' entity.name.tag.block.any.html.angular' ]
8484
85+ describe ' normalization angular tag and attribute' , ->
86+ it ' tokenizes data- prefixed angular attributes' , ->
87+ lines = grammar .tokenizeLines '''
88+ <body data-ng-controller="TestCtrl">
89+ '''
90+
91+ expect (lines[0 ][3 ]).toEqual value : ' data-ng-controller' , scopes : [' text.html.angular' , ' meta.tag.inline.any.html' , ' meta.attribute.html.angular' , ' entity.other.attribute-name.html.angular' ]
92+
93+ it ' tokenizes x- prefixed angular attributes' , ->
94+ lines = grammar .tokenizeLines '''
95+ <body x-ng-controller="TestCtrl">
96+ '''
97+
98+ expect (lines[0 ][3 ]).toEqual value : ' x-ng-controller' , scopes : [' text.html.angular' , ' meta.tag.inline.any.html' , ' meta.attribute.html.angular' , ' entity.other.attribute-name.html.angular' ]
99+
100+ it ' tokenizes _ suffixed angular attributes' , ->
101+ lines = grammar .tokenizeLines '''
102+ <body ng_controller="TestCtrl">
103+ '''
104+
105+ expect (lines[0 ][3 ]).toEqual value : ' ng_controller' , scopes : [' text.html.angular' , ' meta.tag.inline.any.html' , ' meta.attribute.html.angular' , ' entity.other.attribute-name.html.angular' ]
106+
107+ it ' tokenizes : suffixed angular attributes' , ->
108+ lines = grammar .tokenizeLines '''
109+ <body ng:controller="TestCtrl">
110+ '''
111+
112+ expect (lines[0 ][3 ]).toEqual value : ' ng:controller' , scopes : [' text.html.angular' , ' meta.tag.inline.any.html' , ' meta.attribute.html.angular' , ' entity.other.attribute-name.html.angular' ]
113+
85114 describe ' angular expression' , ->
86115 it ' tokenizes angular expressions in HTML tags' , ->
87116 lines = grammar .tokenizeLines '''
0 commit comments