Does conditional syntax not get wikified permanently?

I wanted to copy a prompt to the clipboard. It contained the expression below which is wrapped a button that sits in a macro because it is used twice.

Before I put the button into a macro it was rendered, in the macro the button copies the conditional syntax

\define 2clip()
<%if [{$:/temp/set/Task}match[1]] %>
Die Aufgabenstellung steht jeweils über der Aufgabe.
<%elseif [{$:/temp/set/Task}!match[1]!match[]!match[ ]] %>
Die Aufgabe ist die folgende: {{$:/temp/set/Task}}
<%else%>
Aufgabenstellung und Material habe ich ebenfalls als Photo hochgeladen.
<%endif%>

\end
\define CopyButton()
<$wikify name="clippo" text=<<2clip>> >
<$button message="tm-copy-to-clipboard" param=<<clippo>> class=tc-btn-big-green>
Kopiere den Prompt in die Zwischenablage
</$button>
</$wikify>

![[duck.ai|https://duck.ai/chat?ia=chat&duckai=1]] [[Le Chat Mistral|https://chat.mistral.ai/chat]]

\end

<<CopyButton>>

Fast fix: If take the wikifikation out of the macrodefinition and wrap it arround the <<CopyButton>>macro it works again…
But anyhow this is interesting, becaus the other stuff keeps wikified if it is in the macro…

Try using an actions=... parameter to perform the $button actions, like this:

\define CopyButton_actions()
<$wikify name="clippo" text="<<2clip>>">
<$action-sendmessage $message="tm-copy-to-clipboard" param=<<clippo>>/>
</$wikify>
\end

\define CopyButton()
<$button class=tc-btn-big-green actions="<<CopyButton_actions>>">
Kopiere den Prompt in die Zwischenablage
</$button>
...
/end

This ensures that the $wikify processing is only performed when the button is clicked, instead of when the button is initially rendered.

-e