From 6f9dbd622907f7535a03cb3b6775d523b3dfe646 Mon Sep 17 00:00:00 2001
From: Marco Beretta <81851188+berry-13@users.noreply.github.com>
Date: Fri, 26 Jun 2026 22:13:58 +0200
Subject: [PATCH] fix: preserve url() id casing and record every nested use
chain
---
client/src/utils/__tests__/svg.test.ts | 24 ++++++++++++
client/src/utils/svg.ts | 52 ++++++++++++++++++--------
2 files changed, 60 insertions(+), 16 deletions(-)
diff --git a/client/src/utils/__tests__/svg.test.ts b/client/src/utils/__tests__/svg.test.ts
index 6ac459b78e..e150f1b80a 100644
--- a/client/src/utils/__tests__/svg.test.ts
+++ b/client/src/utils/__tests__/svg.test.ts
@@ -360,6 +360,18 @@ describe('isMonochromeSvg', () => {
'';
expect(isMonochromeSvg(svg)).toBe(true);
});
+
+ it('preserves a glyph instantiated twice with different colors through nested use', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+
+ it('terminates on a self-referential use cycle and still finds its color', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
});
describe('paint set on non-rendering containers', () => {
@@ -525,6 +537,18 @@ describe('isMonochromeSvg', () => {
'';
expect(isMonochromeSvg(svg)).toBe(true);
});
+
+ it('resolves a mixed-case filter id referenced by attribute', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+
+ it('resolves a mixed-case filter id referenced by a CSS rule', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
});
describe('opaque background (not tintable as a mask)', () => {
diff --git a/client/src/utils/svg.ts b/client/src/utils/svg.ts
index 29f6b8f980..a84c6522e2 100644
--- a/client/src/utils/svg.ts
+++ b/client/src/utils/svg.ts
@@ -391,7 +391,9 @@ function currentColorTones(
* the innermost reference outward; nested `