Re: How would i convert this regex using TT replace? ADDL

Summer <crazysummer2004-/[email protected]> Tue, 7 Aug 2012 14:23:38 -0700 (PDT)
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>
Perhaps someone has run into this.. some entry into the database is creating a situation in which the returned string has some sort of line breaks. I tried \n and \r etc.. and no matter what, my Javacript is breaking because I can't seem to identify what is causing these line breaks and thus when I push it into a js var, it breaks.
ala

someJSvar = "this is the returned txt from some template var


Test has some odd line breaks..";




--- On Tue, 8/7/12, Summer <crazysummer2004-/[email protected]> wrote:

From: Summer <crazysummer2004-/[email protected]>
Subject: [Templates] How would i convert this regex using TT replace?
To: [email protected]
Date: Tuesday, August 7, 2012, 1:44 PM

Hello,

I have this in javascript, but having issue converting it to be able to use with template toolkit replace method.

js way:
replace(/(\r\n|\n|\r)/gm,"<br />");

template toolkit way?


-----Inline Attachment Follows-----

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates