fix: strip comments from inline style values in linear time

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pull/18553/head
dnukumamras 3 weeks ago
parent d0dbe1a480
commit fc0f891aa4
No known key found for this signature in database
GPG Key ID: 9B206445453550D9

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: strip comments from inline `style` values in linear time

@ -142,8 +142,9 @@ export function to_style(value, styles) {
}
if (value) {
// strip comments; surrounding whitespace is handled by the trims below
value = String(value)
.replaceAll(/\s*\/\*.*?\*\/\s*/g, '')
.replaceAll(/\/\*.*?\*\//g, '')
.trim();
/** @type {boolean | '"' | "'"} */

Loading…
Cancel
Save