Hi Danielo

I think the problem is that you don't have quotes around the tokens
attribute of the codeLine widget.

If the tokens parameter is the empty string, then you'll end up with:

<$codeLine language="ipx" code={{!!text}} tokens=/>

So, the fix is to include quotes:

\define codereveal( tokens:"" )
<$reveal type="match" state=<<qualify "$:/status/$(currentTiddler)$">>
text="open">
<$codeLine language="ipx" code={{!!text}} tokens="""$tokens$"""/>
</$reveal>
\end

By using triple quotes we allow users to include single quotes in the
parameter value.

Best wishes

Jeremy.



On Tue, Oct 28, 2014 at 4:30 PM, Danielo Rodríguez <[email protected]>
wrote:

> Hello,
>
> I have a macro definition that invokes a widget that I'm developing. The
> default value of the tokens parameter is the empty string. This is the
> macro definition
>
>
> \define codereveal( tokens:"" )
> <$reveal type="match" state=<<qualify "$:/status/$(currentTiddler)$">>
> text="open">
> <$codeLine language="ipx" code={{!!text}} tokens=$tokens$/>
> </$reveal>
> \end
>
>
> Then I'm getting that value in the widget like this:
>  this.userTokens = this.getAttribute("tokens") || undefined;
>  console.log(this.userTokens);
>
>
> But instead of getting what I expect ("" || undefined = undefined ),
> undefined for empty string ("") im getting true. Why?
>
> thanks tgo all
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to