From eee48a758ebcc2b8d9cf126f93365a0962202e41 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 16 Nov 2023 14:14:16 +0100 Subject: [PATCH 1/2] fix: handle closing tags in attributes ...when detecting script language Related to https://github.com/sveltejs/language-tools/issues/2204 --- .changeset/eleven-wombats-begin.md | 5 +++++ packages/vite-plugin-svelte/src/utils/compile.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/eleven-wombats-begin.md diff --git a/.changeset/eleven-wombats-begin.md b/.changeset/eleven-wombats-begin.md new file mode 100644 index 000000000..b1c9220f9 --- /dev/null +++ b/.changeset/eleven-wombats-begin.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/vite-plugin-svelte': patch +--- + +fix: handle closing tags in attributes when detecting script language diff --git a/packages/vite-plugin-svelte/src/utils/compile.js b/packages/vite-plugin-svelte/src/utils/compile.js index dc9dfd4de..804222653 100644 --- a/packages/vite-plugin-svelte/src/utils/compile.js +++ b/packages/vite-plugin-svelte/src/utils/compile.js @@ -7,7 +7,8 @@ import { log } from './log.js'; import { createInjectScopeEverythingRulePreprocessorGroup } from './preprocess.js'; import { mapToRelative } from './sourcemaps.js'; -const scriptLangRE = /