// Static method to Convert "\n" to newlines, "\s" to "\", CR to ""
Tiddler.unescapeLineBreaks = function(text)
{
if(text && text != "")
return
text.replace(/\\n/mg,"\n").replace(/\\s/mg,"\\").replace(/\r/mg,"");
else
return "";
}
// Convert newlines to "\n", "\" to "\s", CR to ""
Tiddler.prototype.escapeLineBreaks = function()
{
return
this.text.replace(/\n/mg,"\\n").replace(/\\/mg,"\\s").replace(/\r/mg,"");
}
Martin
http://trac.tiddlywiki.org/tiddlywiki/ticket/55
I'd like to switch them all over together. I'm worried that it's going
to be fiddly and error prone for the more complex regular expressions
though - it would be nice to be able to automatically convert them...
hmmm a TextMate macro would be nice.
Cheers
Jeremy
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com
Martin