From fb03f62434be929931b43e57f401ae86bf89caa8 Mon Sep 17 00:00:00 2001 From: Barry Pollard Date: Sat, 21 Sep 2024 16:36:27 +0100 Subject: [PATCH] Limit data URLs in css-variables --- 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;