unescapeHtml.js 267 B

12345678910
  1. export function unescape(html) {
  2. return html
  3. .replace(html ? /&(?!#?\w+;)/g : /&/g, '')
  4. .replace(/&lt;/g, "<")
  5. .replace(/&gt;/g, ">")
  6. .replace(/&quot;/g, "\"")
  7. .replace(/&#39;/g, "\'")
  8. .replace(/nbsp;/g,"\u00a0")
  9. .replace(/&amp;/g,"")
  10. }