From 2d8252747ab87e90f0f8f4f4d95c6eb143227f28 Mon Sep 17 00:00:00 2001 From: brufdev Date: Sat, 5 Jul 2025 00:36:46 +0100 Subject: [PATCH] Remove DOMPurify --- package-lock.json | 17 ----------------- package.json | 1 - resources/js/tiptap.js | 5 +---- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9877c2e..01c1242 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "@tiptap/extension-task-list": "^2.12.0", "@tiptap/pm": "^2.12.0", "@tiptap/starter-kit": "^2.12.0", - "dompurify": "^3.2.5", "lowlight": "^3.3.0", "marked": "^15.0.11", "turndown": "^7.2.0" @@ -1649,13 +1648,6 @@ "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", "license": "MIT" }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "license": "MIT", - "optional": true - }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -1896,15 +1888,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/dompurify": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.6.tgz", - "integrity": "sha512-/2GogDQlohXPZe6D6NOgQvXLPSYBqIWMnZ8zzOhn09REE4eyAzb+Hed3jhoM9OkuaJ8P6ZGTTVWQKAi8ieIzfQ==", - "license": "(MPL-2.0 OR Apache-2.0)", - "optionalDependencies": { - "@types/trusted-types": "^2.0.7" - } - }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", diff --git a/package.json b/package.json index 3b10120..6219dd5 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@tiptap/extension-task-list": "^2.12.0", "@tiptap/pm": "^2.12.0", "@tiptap/starter-kit": "^2.12.0", - "dompurify": "^3.2.5", "lowlight": "^3.3.0", "marked": "^15.0.11", "turndown": "^7.2.0" diff --git a/resources/js/tiptap.js b/resources/js/tiptap.js index c54106f..637dcb3 100644 --- a/resources/js/tiptap.js +++ b/resources/js/tiptap.js @@ -7,7 +7,6 @@ import TaskList from '@tiptap/extension-task-list'; import Table from '@tiptap/extension-table'; import TableRow from '@tiptap/extension-table-row'; import { common, createLowlight } from 'lowlight'; -import DOMPurify from 'dompurify'; import { CustomCodeBlockLowlight } from './tiptap/extension-custom-code-block-low-light'; import { CustomTableHeader } from './tiptap/extension-custom-table-header'; @@ -46,9 +45,7 @@ window.setupEditor = function (options) { } if (options.content) { - content = DOMPurify.sanitize( - markedService.parse(options.content), - ); + content = markedService.parse(options.content); } return {