With out expanding on the reasons I want to “Store filters without evaluation?” I would consider it reasonable to be able to store filter strings, as they are for later use. Perhaps to use them in documentation, then later in an example piece of code.
Consider the following;
\define canned-filter() [<transclusion>]
\procedure canned-filter2() [<transclusion>]
\procedure display-string(string) <<string>>
# <<canned-filter>>
# <<canned-filter2>>
# {{somefilter}}
# <$text text=<<canned-filter>>/>
# <<display-string "[<transclusion>]">>
# <$macrocall $name=display-string string=`$(canned-filter)$`>>
But this is the result I get;
I want to see [<transclusion>]
that I could pass as a “literal” parameter to a widget or function etc…
The html preview shows
<ol>
<li>[<transclusion>]</transclusion></li>
<li>[<transclusion>]</transclusion></li>
<li>[<transclusion>]</transclusion></li>
<li>[<transclusion>]</li> <!-- note the HTML encoding -->
<li>[<transclusion>]</transclusion></li>
<li>[<transclusion>]</transclusion></li>
</ol>
- Line breaks added for =ease of reading
- You can see here the parser is autoclosing this as a html tag.
I have tried a number of other ways but as you can see we can only “view” the real value of a filter stored in a variable by using the text widget.
Basically it seems that the parser refuses to leave the <varname>
alone and treats it as html, even although it is inside a filter?
It is understandable because we may want html to be stored inside a variable or tiddler to be parsed correctly.
What could we do about this?
- Are there any work arounds I could use?
- Is this a bug or unintended consequence?
- Can we get a fix or a way to annotate this?
- perhaps a new widget/pragma or variation of the set widget would allow us to set a variable to a string without first attempting to apply HTML rules to it?