Replaces special characters in a string with their HTML-escaped equivalents.

htmlEditFormat( string [, version] ) → returns string

The htmlEditFormat function is DEPRECATED as of ColdFusion 11

Argument Reference

string string

A string or a variable that contains one.

version numeric
Default: 2.0

HTML version to use; currently ignored.
  • -1
  • 2
  • 3.2



DEPRECATED since version 11 Use encodeForHTML, which can provide more protection from XSS.

Sample code invoking the htmlEditFormat function

htmlEditFormat( "This is a test & this is another <This text is in angle brackets> Previous line was blank!!!" )

Expected Result: This is a test &amp; this is another &lt;This text is in angle brackets&gt; Previous line was blank!!!

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub