[html] Format code of type="text/babel" scripts in html files. Fixes #39866

This commit is contained in:
Martin Aeschlimann
2019-10-09 16:17:31 +02:00
parent 2990a8f4d0
commit 13d3f41417

View File

@@ -56,7 +56,7 @@ export function getDocumentRegions(languageService: LanguageService, document: T
}
importedScripts.push(value);
} else if (lastAttributeName === 'type' && lastTagName.toLowerCase() === 'script') {
if (/["'](module|(text|application)\/(java|ecma)script)["']/.test(scanner.getTokenText())) {
if (/["'](module|(text|application)\/(java|ecma)script|text\/babel)["']/.test(scanner.getTokenText())) {
languageIdFromType = 'javascript';
} else {
languageIdFromType = undefined;
@@ -228,4 +228,4 @@ function getAttributeLanguage(attributeName: string): string | null {
return null;
}
return match[1] ? 'css' : 'javascript';
}
}