ts sem tokens in html

This commit is contained in:
Martin Aeschlimann
2020-01-07 17:54:47 +01:00
parent df419967a6
commit f24b58c186
10 changed files with 253 additions and 116 deletions

View File

@@ -58,6 +58,8 @@ export function getDocumentRegions(languageService: LanguageService, document: T
} else if (lastAttributeName === 'type' && lastTagName.toLowerCase() === 'script') {
if (/["'](module|(text|application)\/(java|ecma)script|text\/babel)["']/.test(scanner.getTokenText())) {
languageIdFromType = 'javascript';
} else if (/["']text\/typescript["']/.test(scanner.getTokenText())) {
languageIdFromType = 'typescript';
} else {
languageIdFromType = undefined;
}