unescapeHtml function

String unescapeHtml(
  1. String text
)

Unescape HTML entities back to characters.

Implementation

String unescapeHtml(String text) {
  return text
      .replaceAll('&', '&')
      .replaceAll('&lt;', '<')
      .replaceAll('&gt;', '>')
      .replaceAll('&quot;', '"')
      .replaceAll('&#39;', "'")
      .replaceAll('&#x27;', "'")
      .replaceAll('&#x2F;', '/');
}