From 2f11c9d254e7aeea75cf2627a39fd8fa4b27084e Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Wed, 15 Mar 2023 22:05:26 +0800 Subject: [PATCH] remove sanitize Fixes #76 --- package.json | 1 - .../Chat/ChatContent/Message/MessageContent.tsx | 2 -- yarn.lock | 16 ---------------- 3 files changed, 19 deletions(-) diff --git a/package.json b/package.json index bfd11a1..b8e8ef2 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "react-scroll-to-bottom": "^4.2.0", "rehype-highlight": "^6.0.0", "rehype-katex": "^6.0.2", - "rehype-sanitize": "^5.0.1", "remark-gfm": "^3.0.1", "remark-math": "^5.1.1", "uuid": "^9.0.0", diff --git a/src/components/Chat/ChatContent/Message/MessageContent.tsx b/src/components/Chat/ChatContent/Message/MessageContent.tsx index cba75cc..4e1b341 100644 --- a/src/components/Chat/ChatContent/Message/MessageContent.tsx +++ b/src/components/Chat/ChatContent/Message/MessageContent.tsx @@ -8,7 +8,6 @@ import { useTranslation } from 'react-i18next'; import ReactMarkdown from 'react-markdown'; import { CodeProps, ReactMarkdownProps } from 'react-markdown/lib/ast-to-react'; import rehypeKatex from 'rehype-katex'; -import rehypeSanitize from 'rehype-sanitize'; import rehypeHighlight from 'rehype-highlight'; import remarkMath from 'remark-math'; import remarkGfm from 'remark-gfm'; @@ -136,7 +135,6 @@ const ContentView = React.memo( [remarkMath, { singleDollarTextMath: false }], ]} rehypePlugins={[ - rehypeSanitize, [rehypeKatex, { output: 'mathml' }], [ rehypeHighlight, diff --git a/yarn.lock b/yarn.lock index c852251..24556bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -935,13 +935,6 @@ hast-util-parse-selector@^3.0.0: dependencies: "@types/hast" "^2.0.0" -hast-util-sanitize@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-4.1.0.tgz#d90f8521f5083547095c5c63a7e03150303e0286" - integrity sha512-Hd9tU0ltknMGRDv+d6Ro/4XKzBqQnP/EZrpiTbpFYfXv/uOhWeKc+2uajcbEvAEH98VZd7eII2PiXm13RihnLw== - dependencies: - "@types/hast" "^2.0.0" - hast-util-to-text@^3.0.0, hast-util-to-text@^3.1.0: version "3.1.2" resolved "https://registry.yarnpkg.com/hast-util-to-text/-/hast-util-to-text-3.1.2.tgz#ecf30c47141f41e91a5d32d0b1e1859fd2ac04f2" @@ -1950,15 +1943,6 @@ rehype-parse@^8.0.0: parse5 "^6.0.0" unified "^10.0.0" -rehype-sanitize@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/rehype-sanitize/-/rehype-sanitize-5.0.1.tgz#dac01a7417bdd329260c74c74449697b4be5eb56" - integrity sha512-da/jIOjq8eYt/1r9GN6GwxIR3gde7OZ+WV8pheu1tL8K0D9KxM2AyMh+UEfke+FfdM3PvGHeYJU0Td5OWa7L5A== - dependencies: - "@types/hast" "^2.0.0" - hast-util-sanitize "^4.0.0" - unified "^10.0.0" - remark-gfm@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f"