pull/18553/merge
Mukund Sarma 2 weeks ago committed by GitHub
commit 9ec7d4bb1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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