function unescapeHTML(str) {
  if (typeof window === 'undefined' || !('DOMParser' in window)) {
    return str;
  }
  const elem = document.createElement('textarea');
  elem.innerHTML = str;
  return elem.value;
}
Unescape HTML characters like &lt, &gt, &amp and etc.
@param {string} str - The string to unescape.
@returns {string} - The unescaped string.