From 4b6f43b86062a23718fb720e85507e74cb5de942 Mon Sep 17 00:00:00 2001 From: Barry Pollard Date: Wed, 25 Sep 2024 19:07:16 +0100 Subject: [PATCH] Limit data URLs in css-variables (#145) --- dist/css-variables.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/css-variables.js b/dist/css-variables.js index 16dfa844..f4171e12 100644 --- a/dist/css-variables.js +++ b/dist/css-variables.js @@ -46,6 +46,9 @@ function walkRule(rule, ret) { for (let property of style) { let value = style.getPropertyValue(property); + if (value.startsWith("url(\"data:image/svg+xml") && value.length > 54) { + value = value.slice(0, 50) + '…' + "\");"; + } let containsRef = value.indexOf("var(--") > -1; let setsVar = property.indexOf("--") === 0 && property.indexOf("--" + PREFIX) === -1;