mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(build): 🐛 aaa
This commit is contained in:
parent
c251853194
commit
5ef7564ee8
3 changed files with 6 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue