From cec53509ae7e7866d3f0e0f671472a43bb9664b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Th=C3=A9ophile=20Desmedt?=
<34781168+DesignThinkerer@users.noreply.github.com>
Date: Sat, 7 Dec 2024 00:35:57 +0100
Subject: [PATCH] Add another example to the wikify widget : use core svg to
show an icon next to links
---
.../TestCases_WikifyWidget_RenderSVGURI.tid | 50 +++++++++++++++++++
.../tw5.com/tiddlers/widgets/WikifyWidget.tid | 6 ++-
2 files changed, 55 insertions(+), 1 deletion(-)
create mode 100644 editions/tw5.com/tiddlers/TestCases_WikifyWidget_RenderSVGURI.tid
diff --git a/editions/tw5.com/tiddlers/TestCases_WikifyWidget_RenderSVGURI.tid b/editions/tw5.com/tiddlers/TestCases_WikifyWidget_RenderSVGURI.tid
new file mode 100644
index 00000000000..b5cbfbb1a3d
--- /dev/null
+++ b/editions/tw5.com/tiddlers/TestCases_WikifyWidget_RenderSVGURI.tid
@@ -0,0 +1,50 @@
+created: 20241206225533517
+description: Rendering parametrized svg for use in stylesheets
+modified: 20241206233219095
+tags: $:/tags/wiki-test-spec
+title: TestCases/WikifyWidget/RenderSVGURI
+type: text/vnd.tiddlywiki-multiple
+
+title: Narrative
+
+The core svg icons use a parameter widget, making their use in stylesheets impossible without wikify.
++
+title: Output
+
+https://tiddlywiki.com/
+
+
++
+title: Stylesheet
+
+\rules except dash
+\procedure mask(img)
+<$tiddler tiddler=<>
+><$wikify name="image" text={{!!text}} mode="inline" output="html"
+><$let
+ type={{!!type}}
+ uri={{!!_canonical_uri}}
+ external=`color:transparent;--mask:unset;--url:url($(uri)$)`
+ base64=`color:transparent;--mask:unset;--url:url(data:${[{!!type}]}$;base64,$(image)$)`
+ svg=`--mask:url('data:image/svg+xml;utf8,')`
+ ><$text text={{{ [!is[blank]then]~[!is[blank]!search[svg]then]~[