Might be of any help

http://groups.google.com/group/tiddlywiki/browse_thread/thread/e028c2aaa8017175/cdf4ea7cd438f6a9?lnk=gst&q=spread#cdf4ea7cd438f6a9

On 10 avr, 22:38, Rolf S <[email protected]> wrote:
> I want to use the forEachTiddlerPlugin [1] in a template. How do I
> properly escape string literals in the javascript inserted in the
> plugin?
>
> Here's roughly what I want to achieve (as a simplified example): In
> every tiddler, I want to output the title of each tiddler which starts
> with the title of the current tiddler but with an exclamation mark at
> the end.
>
> What doesn't work is including the following in ViewTemplate:
>
> <div macro ='forEachTiddler where
> "tiddler.title.substring(0,context.inTiddler.title.length)==context.inTiddl 
> er.title
> && context.inTiddler.title.length < tiddler.title.length" write
> "tiddler.title+\"!\"" '></div>
>
> The problem is escaping the javscript string delimiters around the
> exclamation mark, i.e. the part \"!\" in the above code.
>
> I could of course write a plugin providing a global function (say
> document.addExclamationMark = function(name) { return name+"!";};
> ), but that somehow seems not right.
>
> Any help is appreciated!
>
> Rolf
>
> [1]http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to