修复聊天 Markdown 纯文本链接兼容性
让链接和图片渲染为直接文本节点 避免既有消息文本查询被 Markdown 节点拆分 补充后续安全外链 TODO
This commit is contained in:
@@ -45,8 +45,9 @@ class MarkdownErrorBoundary extends Component<
|
||||
}
|
||||
|
||||
const markdownComponents: Components = {
|
||||
a: ({ children }) => <span>{children}</span>,
|
||||
img: ({ alt }) => <span>{alt?.trim() ? `图片:${alt}` : '图片已省略'}</span>,
|
||||
// TODO: 产品确认安全外链策略后,再将链接文本恢复为可点击元素。
|
||||
a: ({ children }) => children,
|
||||
img: ({ alt }) => (alt?.trim() ? `图片:${alt}` : '图片已省略'),
|
||||
h1: ({ children }) => (
|
||||
<h1 className="m-0 mt-4 text-xl font-bold first:mt-0">{children}</h1>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user