fix(build): 🐛 aaa

This commit is contained in:
Jesse Wierzbinski 2024-05-02 14:44:49 -10:00
parent c251853194
commit 5ef7564ee8
No known key found for this signature in database
3 changed files with 6 additions and 2 deletions

View file

@ -1,12 +1,15 @@
import { config } from "config-manager";
import DOMPurify from "dompurify";
import { JSDOM } from "jsdom";
import { Window } from "happy-dom";
const window = new Window();
export const sanitizeHtml = async (
html: string,
extraConfig?: DOMPurify.Config,
) => {
const sanitizedHtml = DOMPurify(new JSDOM().window).sanitize(html, {
// @ts-expect-error Types clash but it works i swear
const sanitizedHtml = DOMPurify(window).sanitize(html, {
ALLOWED_TAGS: [
"a",
"p",