This content has been marked as final. Show 5 replies
> I've tried bunch of string functions but I couldn't get it to work, I am trying
> to convert something like:
> None &lt;/div&gt; INTO None &</div&>
> so it would display correctly on the page.
> Is my only option that's left Replace or is there an actual function that
> would do this?
Which way are you trying to get to display. I would expect the first
example to display correctly in a browser as it is escaped. Are you
trying to escape mark up do that is displays the code or to un-escaped
the content so that it is rendered or just display the output?
I would like it to display as un-escaped, so it will only show text and not html code.
> I would like it to display as un-escaped, so it will only show text and not html code.
Sorry, I am not aware of any built-in reverse to the HTMLeditFormat()
and HTMLcodeFormat() functions. You might try the cflib.org site to see
if anybody has created one already. Otherwise show you code and we can
try and help you role your own solution.
You can use ReplaceList to get it to replace the escape characters, something like:
You can expand the lists to include all special characters. You'll also have to run the code multiple times, given your example. The first time you run it &lt;/div&gt; will get converted to </div> The second time you should get </div>. To run it multiple times, you can use a while loop with a regular expression. Something like:
<cfloop condition="ReFind('\&[^;\s]+\;',str, 0, 0)"></cfloop>
Forgive me if the code is not exactly right, I didn't test it, but you should get the idea.
Thank you for your help!