Skip to content

Commit

Permalink
fix: handle closing tags in attributes
Browse files Browse the repository at this point in the history
...when detecting script language
Related to sveltejs/language-tools#2204
  • Loading branch information
dummdidumm committed Nov 16, 2023
1 parent 907e810 commit eee48a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eleven-wombats-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/vite-plugin-svelte': patch
---

fix: handle closing tags in attributes when detecting script language
3 changes: 2 additions & 1 deletion packages/vite-plugin-svelte/src/utils/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { log } from './log.js';
import { createInjectScopeEverythingRulePreprocessorGroup } from './preprocess.js';
import { mapToRelative } from './sourcemaps.js';

const scriptLangRE = /<script [^>]*lang=["']?([^"' >]+)["']?[^>]*>/;
const scriptLangRE =
/<script (?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s])\s+)*)lang=["']?([^"' >]+)["']?[^>]*>/;

import { isSvelte3 } from './svelte-version.js';

Expand Down

0 comments on commit eee48a7

Please sign in to comment.