Skip to content

Commit 34fd960

Browse files
authored
🧹 chore: remove legacy markdown code (danny-avila#3789)
1 parent 5694ad4 commit 34fd960

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

client/src/components/Chat/Messages/Content/Markdown.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import React, { memo, useMemo } from 'react';
22
import remarkGfm from 'remark-gfm';
3-
import rehypeRaw from 'rehype-raw';
43
import remarkMath from 'remark-math';
54
import supersub from 'remark-supersub';
65
import rehypeKatex from 'rehype-katex';
76
import { useRecoilValue } from 'recoil';
87
import ReactMarkdown from 'react-markdown';
98
import type { PluggableList } from 'unified';
109
import rehypeHighlight from 'rehype-highlight';
11-
import { langSubset, validateIframe, preprocessLaTeX, handleDoubleClick } from '~/utils';
10+
import { langSubset, preprocessLaTeX, handleDoubleClick } from '~/utils';
1211
import CodeBlock from '~/components/Messages/Content/CodeBlock';
1312
import { useFileDownload } from '~/data-provider';
1413
import useLocalize from '~/hooks/useLocalize';
@@ -136,11 +135,9 @@ const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }:
136135
subset: langSubset,
137136
},
138137
],
139-
[rehypeRaw],
140138
];
141139

142140
if (isInitializing) {
143-
rehypePlugins.pop();
144141
return (
145142
<div className="absolute">
146143
<p className="relative">
@@ -150,12 +147,7 @@ const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }:
150147
);
151148
}
152149

153-
let isValidIframe: string | boolean | null = false;
154-
if (isEdited !== true) {
155-
isValidIframe = validateIframe(currentContent);
156-
}
157-
158-
if (isEdited === true || (!isLatestMessage && !isValidIframe)) {
150+
if (isEdited === true || !isLatestMessage) {
159151
rehypePlugins.pop();
160152
}
161153

0 commit comments

Comments
 (0)