ant-design / pro-chat

🤖 Components Library for Quickly Building LLM Chat Interfaces.
https://pro-chat.antdigital.dev
MIT License
668 stars 83 forks source link

🐛[BUG] 代码块中,无法正常显示 html 代码 #127

Closed yangfuhai closed 5 months ago

yangfuhai commented 6 months ago

🐛 bug 描述

让 ai 写一段 html 的 hello world, ai 返回的 html 内容如下时, html 代码块显示不正确:

在HTML中编写一个“Hello World”非常简单,以下是一个基本的例子:

<!DOCTYPE html>
<html>
<head>
    <title>Hello World Page</title>
</head>
<body>

<h1>Hello World!</h1>

</body>
</html>

这段代码将在浏览器中显示一个标题为“Hello World!”的网页。<!DOCTYPE html>声明告诉浏览器这是一个HTML5文档,<html>标签定义了整个HTML文档的开始和结束。<head>标签包含了文档的元数据,比如标题,而<body>标签内包含的是网页的所有可见内容。在这个例子中,<h1>标签表示一个一级标题,其中包含了文本“Hello World!”。

📷 复现步骤

让 ai 返回一段 html 代码即可复现。

🏞 期望结果

能够正常渲染 html 代码块

💻 复现代码

© 版本信息

🚑 其他信息

以下是错误渲染的截图:

image

ONLY-yours commented 6 months ago

@rdmclin2 看起来是直接用的 pro-editor,看看这个

rdmclin2 commented 6 months ago

目测是 Markdown 自动解析了 html 代码展示,我这边切换语言就可以看到代码,我瞧瞧。

carmanchang commented 5 months ago

遇到同样问题,pro-editor看官网上例子展示html代码是正常的,pro-chat里不正常

ONLY-yours commented 5 months ago

遇到同样问题,pro-editor看官网上例子展示html代码是正常的,pro-chat里不正常

@carmanchang 我看 proEditor 还没发版本,修好了官网以及上去了

image

@rdmclin2 帮忙 Editor 发个 fix