pull/10046/head
navorite 3 years ago
parent 3bcb337d9b
commit d1e0298736

@ -2,4 +2,4 @@
'svelte': patch
---
fix: improve script `lang` attribute matching
fix: improve script `lang` attribute detection

@ -54,7 +54,7 @@ export class Parser {
do match_lang = regex_lang_attribute.exec(template);
while (match_lang && match_lang[0][1] !== 's'); // ensure it starts with '<s' to match script tags
regex_lang_attribute.lastIndex = 0; // need to reset index to pass tests — otherwise do not use global regex
regex_lang_attribute.lastIndex = 0; // reset matched index to pass tests - otherwise declare the regex inside the constructor
this.ts = match_lang?.[2] === 'ts';

Loading…
Cancel
Save