We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bcb337 commit d1e0298Copy full SHA for d1e0298
.changeset/hip-balloons-begin.md
@@ -2,4 +2,4 @@
2
'svelte': patch
3
---
4
5
-fix: improve script `lang` attribute matching
+fix: improve script `lang` attribute detection
packages/svelte/src/compiler/phases/1-parse/index.js
@@ -54,7 +54,7 @@ export class Parser {
54
do match_lang = regex_lang_attribute.exec(template);
55
while (match_lang && match_lang[0][1] !== 's'); // ensure it starts with '<s' to match script tags
56
57
- 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
58
59
this.ts = match_lang?.[2] === 'ts';
60
0 commit comments