Well, that's not quite the solution after all, because I keep getting this error:
Uncaught RangeError: Maximum call stack size exceeded
I don't have issues with the macro on
tiddlywiki.com, so I don't know what I'm doing wrong. Can anyone figure out what's wrong?
I'm using the macro in the caption field like this:
<$macrocall $name="padder" str={{!!cnum}} len=2/>: {{!!title}}
The idea is to have the title replaced in link-lists with the caption, which shows the card number (cnum) and the title of the card, ala "05 : Cilantro" or "08 : Emerald".
And just in case, this is the macro definition I used (from that link I posted before, which is Mark S's code:
\define padder-reg() ^$(len)$$
\define padder(str,len,chr:"0")
<$vars len=<<__len__>>>
<$list filter="[<__str__>addprefix<__chr__>]" variable="padstr">
<$list filter="[<padstr>length[]!regexp<padder-reg>]" emptyMessage=<<padstr
>>>
<$macrocall $name="padder" str=<<padstr>> len=<<__len__>> chr=<<__chr__>>/>
</$list>
</$list>
</$vars>
\end