Bug in setwidget?

41 views
Skip to first unread message

Mat

unread,
Jun 21, 2017, 4:04:19 AM6/21/17
to TiddlyWikiDev
As per example for SetWidget given in docs, under "Conditional Variable Assignment":

<$set name="myVariable" filter="" value="It's magic" emptyValue="It's not magic">
<$text text=<<myVariable>>/>
</$set>

As seen, I have edited the filter to be totally emtpy. 

IMO the result should be the emptyValue... but it returns the value (It's magic). Surely that can't be correct or do I misunderstand something?

<:-)

Eric Shulman

unread,
Jun 21, 2017, 4:17:19 AM6/21/17
to TiddlyWikiDev
The TW parser doesn't differentiate between a parameter with a blank value and a parameter that is not specified at all.  Thus, since filter="", it's as if you had just written
<$set name="myVariable" value="It's magic">
(the emptyValue="..." param is ignored unless a non-blank filter is used)

-e

Reply all
Reply to author
Forward
0 new messages