From 34fd960d54d8536cab35934a0c53015c7aef4dd1 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Mon, 26 Aug 2024 17:53:19 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20remove=20legacy=20markd?= =?UTF-8?q?own=20code=20(#3789)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Chat/Messages/Content/Markdown.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/client/src/components/Chat/Messages/Content/Markdown.tsx b/client/src/components/Chat/Messages/Content/Markdown.tsx index 5439bc102a..131a86a480 100644 --- a/client/src/components/Chat/Messages/Content/Markdown.tsx +++ b/client/src/components/Chat/Messages/Content/Markdown.tsx @@ -1,6 +1,5 @@ import React, { memo, useMemo } from 'react'; import remarkGfm from 'remark-gfm'; -import rehypeRaw from 'rehype-raw'; import remarkMath from 'remark-math'; import supersub from 'remark-supersub'; import rehypeKatex from 'rehype-katex'; @@ -8,7 +7,7 @@ import { useRecoilValue } from 'recoil'; import ReactMarkdown from 'react-markdown'; import type { PluggableList } from 'unified'; import rehypeHighlight from 'rehype-highlight'; -import { langSubset, validateIframe, preprocessLaTeX, handleDoubleClick } from '~/utils'; +import { langSubset, preprocessLaTeX, handleDoubleClick } from '~/utils'; import CodeBlock from '~/components/Messages/Content/CodeBlock'; import { useFileDownload } from '~/data-provider'; import useLocalize from '~/hooks/useLocalize'; @@ -136,11 +135,9 @@ const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }: subset: langSubset, }, ], - [rehypeRaw], ]; if (isInitializing) { - rehypePlugins.pop(); return (

@@ -150,12 +147,7 @@ const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }: ); } - let isValidIframe: string | boolean | null = false; - if (isEdited !== true) { - isValidIframe = validateIframe(currentContent); - } - - if (isEdited === true || (!isLatestMessage && !isValidIframe)) { + if (isEdited === true || !isLatestMessage) { rehypePlugins.pop(); }