import xss from "xss"; type DefaultConfig = {whiteList: Record} const defaultConfig: DefaultConfig = { whiteList: { a: ["href"], abbr: ["title"], b: [], br: [], del: [], div: [], em: [], hr: [], i: [], p: [], pre: [], s: [], small: [], span: [], strike: [], strong: [], sub: [], sup: [], u: [], iframe: ["src"], img: ["alt", "src"], } }; export const sanitizeHtml = (html: string, options: DefaultConfig = defaultConfig) => xss(html, options);