Thought I'd share two TrimPath template modifiers with you. Two very simple modifiers but still quite handy.

First is a newline to <br/> modifier which is the one I use the most.
"nl2br" : function(s) { return String(s).replace(/\n/g,"<br/>");}

The second one is a trim-function that strips whitespaces in the beginning and the end of a string. This one requires a external function called trimAll().
"trim" : function(s) { return trimAll(s);}

And the code for trimAll().
function trimAll(sString) {
while (sString.substring(0,1) == ' ') {
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ') {
sString = sString.substring(0,sString.length-1);
}
return sString;
}


To add the modifiers just add the lines of code in the TrimPath.parseTemplate_etc.modifierDef-section of the TrimPath-library. It should look something like this when you're done.
TrimPath.parseTemplate_etc.modifierDef = {
"eat":function(v) { return ""; },
"capitalize":function(s){ return String(s).toUpperCase(); },
"default":function(s, d) { return s != null ? s : d; },
"nl2br":function(s) { return String(s).replace(/\n/g,"<br/>");},
"trim":function(s) { return trimAll(s); }
}