mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(api): 🚑 Replace isomorphic-dompurify with plain jsdom and dompurify
This commit is contained in:
parent
a339b7fa94
commit
74873fe924
3 changed files with 6 additions and 3 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue