diff --git a/syntaxes/html.json b/syntaxes/html.json index 2d07c93b..2358e6e5 100644 --- a/syntaxes/html.json +++ b/syntaxes/html.json @@ -41,7 +41,7 @@ "name": "meta.string.interpolation" }, "meta.tag.block.any.html": { - "begin": "(<\/?)((?i:address|blockquote|dd|div|section|article|aside|header|footer|nav|menu|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|pre)\\b)", + "begin": "(<\/?)((?i:address|blockquote|dd|div|section|article|aside|header|footer|nav|menu|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|pre)(?!-)\\b)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" @@ -64,7 +64,7 @@ ] }, "meta.tag.inline.any.html": { - "begin": "(<\/?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)", + "begin": "(<\/?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)(?!-)\\b)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" diff --git a/test/syntax.html/generic.test.ts b/test/syntax.html/generic.test.ts index 776caedf..6b01182f 100644 --- a/test/syntax.html/generic.test.ts +++ b/test/syntax.html/generic.test.ts @@ -1,5 +1,5 @@ import { assert } from 'chai'; -import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; +import { getTokenOnCharRange, hasScope, tokenizeLine, writeOut } from './test.utils'; describe('The Aurelia HTML syntax', () => { @@ -59,4 +59,32 @@ describe('The Aurelia HTML syntax', () => { }); + it('must tokenize inline element with dash as scope "entity.name.tag.other.html"', () => { + + // arrange + let scope = 'entity.name.tag.other.html'; + + // act + let lineToken = tokenizeLine(''); + + // assert + let token = getTokenOnCharRange(lineToken, 1, 11); + assert.isOk(hasScope(token.scopes, scope)); + + }); + + it('must tokenize block element with dash as scope "entity.name.tag.other.html"', () => { + + // arrange + let scope = 'entity.name.tag.other.html'; + + // act + let lineToken = tokenizeLine(''); + + // assert + let token = getTokenOnCharRange(lineToken, 1, 11); + assert.isOk(hasScope(token.scopes, scope)); + + }); + });