mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 19:30:04 +08:00
fix: has unsafe elements
This commit is contained in:
parent
30da183578
commit
8ef3ef2a8f
@ -36,7 +36,7 @@ const Markdown: FC<Props> = ({ message }) => {
|
|||||||
}, [message.content, message.status, t])
|
}, [message.content, message.status, t])
|
||||||
|
|
||||||
const rehypePlugins = useMemo(() => {
|
const rehypePlugins = useMemo(() => {
|
||||||
const hasUnsafeElements = /<(input|textarea|select)/i.test(messageContent)
|
const hasUnsafeElements = /<(input|textarea|select|menuitem)/i.test(messageContent)
|
||||||
return hasUnsafeElements ? [rehypeMath] : [rehypeRaw, rehypeMath]
|
return hasUnsafeElements ? [rehypeMath] : [rehypeRaw, rehypeMath]
|
||||||
}, [messageContent, rehypeMath])
|
}, [messageContent, rehypeMath])
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user