File tree 1 file changed +2
-2
lines changed
packages/svelte2tsx/src/utils 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ function parseAttributes(str: string, start: number) {
32
32
33
33
// Regex ensures that attributes with > characters in them still result in the content being matched correctly
34
34
const scriptRegex =
35
- / ( < ! - - [ ^ ] * ?- - > ) | ( < s c r i p t ( (?: \s + [ ^ = > ' " \/ ] + = (?: " [ ^ " ] * " | ' [ ^ ' ] * ' | [ ^ > \s ] + ) | \s + [ ^ = > ' " \/ ] + ) * \s * ) > ) ( [ \S \s ] * ?) < \/ s c r i p t > / g;
35
+ / ( < ! - - [ ^ ] * ?- - > ) | ( < s c r i p t ( (?: \s + [ ^ = > ' " \/ \s ] + = (?: " [ ^ " ] * " | ' [ ^ ' ] * ' | [ ^ > \s ] + ) | \s + [ ^ = > ' " \/ \s ] + ) * \s * ) > ) ( [ \S \s ] * ?) < \/ s c r i p t > / g;
36
36
const styleRegex =
37
- / ( < ! - - [ ^ ] * ?- - > ) | ( < s t y l e ( (?: \s + [ ^ = > ' " \/ ] + = (?: " [ ^ " ] * " | ' [ ^ ' ] * ' | [ ^ > \s ] + ) | \s + [ ^ = > ' " \/ ] + ) * \s * ) > ) ( [ \S \s ] * ?) < \/ s t y l e > / g;
37
+ / ( < ! - - [ ^ ] * ?- - > ) | ( < s t y l e ( (?: \s + [ ^ = > ' " \/ \s ] + = (?: " [ ^ " ] * " | ' [ ^ ' ] * ' | [ ^ > \s ] + ) | \s + [ ^ = > ' " \/ \s ] + ) * \s * ) > ) ( [ \S \s ] * ?) < \/ s t y l e > / g;
38
38
39
39
function extractTag ( htmlx : string , tag : 'script' | 'style' ) {
40
40
const exp = tag === 'script' ? scriptRegex : styleRegex ;
You can’t perform that action at this time.
0 commit comments