KB-1489 The extract() function is unable to handle HTML line breaks

Symptoms

The extract() function is unable to handle the HTML line break tags: <p>, <br>, and <div> (as well as </p>). It parses them as line breaks and does not return the characters.

For example:
extract("<p>Text</p>", "<", ">") returns nothing. It should return "p" and "/p".

Cause

This issue has been reported to the Appian Product Team. The reference number for this issue is AN-96094.

Action

The relevant action depends on the requirement.

  • Use the substitute() function to replace specific HTML tags. To remove them, substitute the values for an empty string. For example:
    substitute(substitute("<p>Text</p>","<p>",""), "</p>", "")
    would remove both the <p> and </p> tags.
  • Or use the toHtml() function which allows for the preservation of the tags in plain text while handling the string as is:
    extract(toHtml("<p>Text</p>"), "<", ">")

Affected Versions

This article affects Appian 16.3 and later.

Last Reviewed: January 2018

Related
Recommended