export function sanitizeHtml(str: string) { const allowedTags = ["a", "b", "em", "br", "strong", "ol", "ul", "li"]; const pattern = new RegExp( `<(/?(?!${allowedTags.join("|")})\\b[^>]*?)>`, "gi" ); return str.replace(pattern, ""); }