diff --git a/.changeset/wicked-clouds-exercise.md b/.changeset/wicked-clouds-exercise.md new file mode 100644 index 0000000000..64c1c0c9b2 --- /dev/null +++ b/.changeset/wicked-clouds-exercise.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: adjust regex diff --git a/packages/svelte/src/compiler/phases/1-parse/index.js b/packages/svelte/src/compiler/phases/1-parse/index.js index eef5178fb1..8c1bb174f8 100644 --- a/packages/svelte/src/compiler/phases/1-parse/index.js +++ b/packages/svelte/src/compiler/phases/1-parse/index.js @@ -11,7 +11,7 @@ import read_options from './read/options.js'; const regex_position_indicator = / \(\d+:\d+\)$/; const regex_lang_attribute = - /|]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s])\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/; + /|]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/; export class Parser { /**