fix(api): 🚑 Replace isomorphic-dompurify with plain jsdom and dompurify

This commit is contained in:
Jesse Wierzbinski 2024-05-02 14:21:09 -10:00
parent a339b7fa94
commit 74873fe924
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View file

@ -1,11 +1,12 @@
import { config } from "config-manager";
import DOMPurify from "isomorphic-dompurify";
import DOMPurify from "dompurify";
import { JSDOM } from "jsdom";
export const sanitizeHtml = async (
html: string,
extraConfig?: DOMPurify.Config,
) => {
const sanitizedHtml = DOMPurify.sanitize(html, {
const sanitizedHtml = DOMPurify(new JSDOM().window).sanitize(html, {
ALLOWED_TAGS: [
"a",
"p",