function sanitizeHtml(html = []) {
  if (!html) return "";

  const disallowedAttributes = [
    "onauxclick",
    "onafterprint",
    "onbeforematch",
    "onbeforeprint",
    "onbeforeunload",
    "onbeforetoggle",
    "onblur",
    "oncancel",
    "oncanplay",
    "oncanplaythrough",
    "onchange",
    "onclick",
    "onclose",
    "oncontextlost",
    "oncontextmenu",
    "oncontextrestored",
    "oncopy",
    "oncuechange",
    "oncut",
    "ondblclick",
    "ondrag",
    "ondragend",
    "ondragenter",
    "ondragleave",
    "ondragover",
    "ondragstart",
    "ondrop",
    "ondurationchange",
    "onemptied",
    "onended",
    "onerror",
    "onfocus",
    "onformdata",
    "onhashchange",
    "oninput",
    "oninvalid",
    "onkeydown",
    "onkeypress",
    "onkeyup",
    "onlanguagechange",
    "onload",
    "onloadeddata",
    "onloadedmetadata",
    "onloadstart",
    "onmessage",
    "onmessageerror",
    "onmousedown",
    "onmouseenter",
    "onmouseleave",
    "onmousemove",
    "onmouseout",
    "onmouseover",
    "onmouseup",
    "onoffline",
    "ononline",
    "onpagehide",
    "onpageshow",
    "onpaste",
    "onpause",
    "onplay",
    "onplaying",
    "onpopstate",
    "onprogress",
    "onratechange",
    "onreset",
    "onresize",
    "onrejectionhandled",
    "onscroll",
    "onscrollend",
    "onsecuritypolicyviolation",
    "onseeked",
    "onseeking",
    "onselect",
    "onslotchange",
    "onstalled",
    "onstorage",
    "onsubmit",
    "onsuspend",
    "ontimeupdate",
    "ontoggle",
    "onunhandledrejection",
    "onunload",
    "onvolumechange",
    "onwaiting",
    "onwheel",
  ];

  const disallowedTags = {
    script: true,
    iframe: true,
  };

  return sanitizeHTML(html, {
    allowedTags: false,
    allowedAttributes: false,
    disallowedTagsMode: "discard",
    allowVulnerableTags: true,
    exclusiveFilter(frame) {
      //...except those in the blacklist
      return disallowedTags[frame.tag];
    },
    nonTextTags: ["script", "textarea", "option", "noscript"],
    transformTags: {
      "*": (tagName, attribs) => {
        Object.keys(attribs).forEach((attr) => {
          // If the attribute is in the disallowed list, remove it
          if (disallowedAttributes.includes(attr)) {
            delete attribs[attr];
          }
        });
        return {
          tagName,
          attribs,
        };
      },
    },
  });
}
Sanitize html from scripts and iframes
@param {string} html
@returns {string}