1
1
import React , { memo , useMemo } from 'react' ;
2
2
import remarkGfm from 'remark-gfm' ;
3
- import rehypeRaw from 'rehype-raw' ;
4
3
import remarkMath from 'remark-math' ;
5
4
import supersub from 'remark-supersub' ;
6
5
import rehypeKatex from 'rehype-katex' ;
7
6
import { useRecoilValue } from 'recoil' ;
8
7
import ReactMarkdown from 'react-markdown' ;
9
8
import type { PluggableList } from 'unified' ;
10
9
import rehypeHighlight from 'rehype-highlight' ;
11
- import { langSubset , validateIframe , preprocessLaTeX , handleDoubleClick } from '~/utils' ;
10
+ import { langSubset , preprocessLaTeX , handleDoubleClick } from '~/utils' ;
12
11
import CodeBlock from '~/components/Messages/Content/CodeBlock' ;
13
12
import { useFileDownload } from '~/data-provider' ;
14
13
import useLocalize from '~/hooks/useLocalize' ;
@@ -136,11 +135,9 @@ const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }:
136
135
subset : langSubset ,
137
136
} ,
138
137
] ,
139
- [ rehypeRaw ] ,
140
138
] ;
141
139
142
140
if ( isInitializing ) {
143
- rehypePlugins . pop ( ) ;
144
141
return (
145
142
< div className = "absolute" >
146
143
< p className = "relative" >
@@ -150,12 +147,7 @@ const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }:
150
147
) ;
151
148
}
152
149
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 ) {
159
151
rehypePlugins . pop ( ) ;
160
152
}
161
153
0 commit comments