From ab0438cc6fa962ce1608ce1b506d2b7561943533 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 11 Dec 2025 13:47:00 +0100 Subject: [PATCH] :bug: Fix svg extract ids --- common/src/app/common/svg.cljc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/svg.cljc b/common/src/app/common/svg.cljc index a3b309b14f..63092d0454 100644 --- a/common/src/app/common/svg.cljc +++ b/common/src/app/common/svg.cljc @@ -546,9 +546,19 @@ filter-values))) (defn extract-ids [val] - (when (some? val) + ;; Extract referenced ids from string values like "url(#myId)". + ;; Non-string values (maps, numbers, nil, etc.) return an empty seq + ;; to avoid re-seq type errors when attributes carry nested structures. + (cond + (string? val) (->> (re-seq xml-id-regex val) - (mapv second)))) + (mapv second)) + + (sequential? val) + (mapcat extract-ids val) + + :else + [])) (defn fix-dot-number "Fixes decimal numbers starting in dot but without leading 0"