diff --git a/src/html.ts b/src/html.ts
index b1da46fd..9115d3d7 100644
--- a/src/html.ts
+++ b/src/html.ts
@@ -52,6 +52,15 @@ export var conf:IRichLanguageConfiguration = {
],
};
+export const htmlTokenTypes = {
+ DELIM_START: 'start.delimiter.tag',
+ DELIM_END: 'end.delimiter.tag',
+ DELIM_COMMENT: 'comment',
+ getTag: (name: string) => {
+ return 'tag';
+ }
+};
+
export var language = {
defaultToken: '',
tokenPostfix: '.html',
@@ -61,11 +70,11 @@ export var language = {
root: [
[//, 'tag'],
- [/)/, [htmlTokenTypes.DELIM_START, 'tag', htmlTokenTypes.DELIM_END]],
+ [/(<)(script)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@script'} ]],
+ [/(<)(style)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@style'} ]],
+ [/(<)(\w+)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@otherTag'} ]],
+ [/(<\/)(\w+)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@otherTag' }]],
[/[^<]+/] // text
],
@@ -81,7 +90,7 @@ export var language = {
],
otherTag: [
- [/\/?>/, 'tag', '@pop'],
+ [/\/?>/, htmlTokenTypes.DELIM_END, '@pop'],
[/"([^"]*)"/, 'attribute.value'],
[/'([^']*)'/, 'attribute.value'],
[/[\w\-]+/, 'attribute.name'],
@@ -98,9 +107,9 @@ export var language = {
[/'([^']*)'/, 'attribute.value'],
[/[\w\-]+/, 'attribute.name'],
[/=/, 'delimiter'],
- [/>/, { token: 'tag', next: '@scriptEmbedded', nextEmbedded: 'text/javascript'} ],
+ [/>/, { token: htmlTokenTypes.DELIM_END, next: '@scriptEmbedded', nextEmbedded: 'text/javascript'} ],
[/[ \t\r\n]+/], // whitespace
- [/<\/script\s*>/, 'tag', '@pop']
+ [/(<\/)(script\s*)(>)/, [ htmlTokenTypes.DELIM_START, 'tag', { token: htmlTokenTypes.DELIM_END, next: '@pop' } ]]
],
// After