What I'd like to do now is
1. change this from a macro to a toolbar command
2. find a way to prevent tiddler content from escaping the body field
Here's the plugin code:
config.macros.mailtiddler = {};
config.macros.mailtiddler.handler = function
(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<html><a href=\"mailto:?subject=" + tiddler.title +
"&body=" + tiddler.text + "\">mail</a></html>", place);
}
I am using <html></html> to prevent ]]'s from escaping, and this seems
to work on simple tiddlers, but not on more complex ones. Not sure if
it is the carriage returns or embeded tiddlers or what.
Anyway, can anyone help me translate the above into a toolbar command?
Any additional insight is appreciated.
It is probably obvious by the code, but I am building mailto links to
send the tiddler title and body to my email client. Right now I'm
adding it as a <span macro="mailtiddler"></span> in my view template.
Thanks!
try using:
tiddler.text.htmlEncode()
instead of just
tiddler.text
That should help with embedded newlines, as well as "<" and ">"...
HTH
-e
Eric Shulman
TiddlyTools / ELS Design Studios