Re: How would i convert this regex using TT replace?
Summer <crazysummer2004-/[email protected]> Wed, 8 Aug 2012 09:26:04 -0700 (PDT)
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <[email protected]> |
Thanks! I tried that - no luck. I think my TT engine is veryyyyyyyyyy old!! Like 10yrs old. So, I don't believe that filter is available to me. :-( --> Is there a way to use regex's to remove all non-utf8 chars from string, from a template perspective? Thanks --- On Wed, 8/8/12, Randal L. Schwartz <[email protected]> wrote: From: Randal L. Schwartz <[email protected]> Subject: Re: [Templates] How would i convert this regex using TT replace? To: "Summer" <crazysummer2004-/[email protected]> Cc: [email protected] Date: Wednesday, August 8, 2012, 5:58 AM >>>>> "Summer" == Summer <crazysummer2004-/[email protected]> writes: Summer> Hello, Summer> I have this in javascript, but having issue converting it to be able to use with template toolkit replace method. Summer> js way: Summer> replace(/(\r\n|\n|\r)/gm,"<br />"); Summer> template toolkit way? Use the built-in FILTER html_line_break: [% some_value FILTER html_line_break %] perldoc Template::Manual::Filters for details -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[email protected]> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.posterous.com/ for Smalltalk discussion _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates