src/textWidth.js
function htmlDecode(input) {
  if (input === " ") return input;
  const doc = new DOMParser().parseFromString(input.replace(/<[^>]+>/g, ""), "text/html");
  return doc.documentElement.textContent;
}
function htmlDecode(input) {
  if (input === " ") return input;
  const doc = new DOMParser().parseFromString(input.replace(/<[^>]+>/g, ""), "text/html");
  return doc.documentElement.textContent;
}
function htmlDecode ( input ) { if ( input === " " ) return input ; const doc = new DOMParser ( ) . parseFromString ( input . replace ( / <[^>]+> / g , "" ) , "text/html" ) ; return doc . documentElement . textContent ; }
Strips HTML and "un-escapes" escape characters.
@param {String} input
Strips HTML and un - escapes escape characters .