Ok I have a bit of code that does a replace on a string changing tabs
and crs to <BR> tags 

But I also want to escape < > to &lt and &gt 

 

<cfscript>

function textareaformat(str)

{

newstr = replace(str, chr(10),'<br>','ALL');

newstr = replace(newstr, chr(13),'<br>','ALL');

newstr = replace(newstr, chr(60),'&lt;','ALL');

newstr = replace(newstr, chr(62),'&gt;','ALL');

return newstr;

}

</cfscript>

 

looks good .. heh but .. of course that will replace the  < > in the BR
to &lt and &gt as well :-) 

heheh 

 

so I ask how do I combine these two different  actions into one function
- :-) 

retaining <BR> and having  < > escaped to &lt and &gt  with out
affecting the <br>

 

- Paul 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 10/11/2003
 

Reply via email to