We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 157f8ea commit ed12846Copy full SHA for ed12846
packages/svelte/src/preprocessors.ts
@@ -127,7 +127,7 @@ function hasScriptTag(content: string): boolean {
127
// They use this regex to find matching script tags that are passed to the `script` preprocessor hook:
128
// https://github.com/sveltejs/svelte/blob/bb83eddfc623437528f24e9fe210885b446e72fa/src/compiler/preprocess/index.ts#L144
129
// However, we remove the first part of the regex to not match HTML comments
130
- const scriptTagRegex = /<script(\s[^]*?)?(?:>([^]*?)<\/script>|\/>)/gi;
+ const scriptTagRegex = /<script(\s[^]*?)?(?:>([^]*?)<\/script\s*>|\/>)/gi;
131
132
// Regex testing is not a super safe way of checking for the presence of a <script> tag in the Svelte
133
// component file but I think we can use it as a start.
0 commit comments