[html] errors in attributes on missing semicolons and parens. Fixes #15970

This commit is contained in:
Martin Aeschlimann 2016-11-23 19:41:36 +01:00
parent 0a60061ce7
commit 520fb13462
2 changed files with 4 additions and 1 deletions

View file

@ -225,7 +225,7 @@ function append(result: string, str: string, n: number): string {
} }
function getAttributeLanguage(attributeName: string): string { function getAttributeLanguage(attributeName: string): string {
let match = attributeName.match(/^(style)|(on\w+)$/i); let match = attributeName.match(/^(style)$|^(on\w+)$/i);
if (!match) { if (!match) {
return null; return null;
} }

View file

@ -106,6 +106,9 @@ suite('HTML Embedded Support', () => {
assertLanguageId('<DIV ONKEYUP=foo(|)</DIV>', 'javascript'); assertLanguageId('<DIV ONKEYUP=foo(|)</DIV>', 'javascript');
assertLanguageId('<DIV ONKEYUP=foo()|</DIV>', 'javascript'); assertLanguageId('<DIV ONKEYUP=foo()|</DIV>', 'javascript');
assertLanguageId('<DIV ONKEYUP=foo()<|/DIV>', 'html'); assertLanguageId('<DIV ONKEYUP=foo()<|/DIV>', 'html');
assertLanguageId('<label data-content="|Checkbox"/>', 'html');
assertLanguageId('<label on="|Checkbox"/>', 'html');
}); });
test('Script content', function (): any { test('Script content', function (): any {