ESCAPEHTML Operation

How to use the ESCAPEHTML operation for Computed Attributes

Definition

Example

Syntax Guide

Formula In Use


Definition

The ESCAPEHTML operation removes all HTML tags from a text.


Example

ESCAPEHTML(“<script>alert(‘Hello’)</script><b>Hello World</b>”)

Result:
Hello World


Syntax Guide

ESCAPEHTML(text)

text - The text string to remove HTML tags from

 


Formulas In Use

You can copy and paste the formulas below to use in your own account. Just remember to replace the attribute being used ($ATT.RICH_TEXT) with one in your account. 

 

Stripping HTML With Line Breaks

Stripping HTML With Line Breaks and Keeping Bullet Points

 

Stripping HTML With Line Breaks

In order to remove all the HTML code from a Rich text but still maintain the text in different lines as a paragraph.

Transforming this: “<ul><li>This</li><li>That</li><li>The other<br></li></ul>”

Into this:

“This

That

The other”

 

Formula:

ESCAPEHTML(SUBSTITUTE($ATT.RICH_TEXT,"<li>", "
"))

screely-escape HTML

Stripping HTML With Line Breaks and Keeping Bullet Points

Maintain bullet points in the plain text version by adding the symbol in the bullet point symbol.

 

Formula:

ESCAPEHTML(SUBSTITUTE($ATT.RICH_TEXT,"<li>", "
•"))

screely-HTML bullets

 


What's Next?

 

If you have any questions just click on the chat box in the bottom-right corner and we'll be happy to answer them...

 

and please let us know 👇