feat(web): 支持用户消息 Markdown 渲染 - #1178
Closed
qqqqqf-q wants to merge 2 commits into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
用户发送的 Markdown 此前在聊天气泡中按纯文本显示,例如
**重点**会直接显示星号。现在用户消息复用现有聊天 Markdown 渲染器,支持标题、强调、列表、引用、代码块、表格和链接,并沿用中英文混排组件。复制与编辑仍使用 Markdown 原文。长消息保留展开/收起入口,折叠改用约 11 行的高度上限,以覆盖代码块和表格;同时观察内容高度变化,支持异步渲染后重新判断是否溢出。用户气泡内的引用和链接沿用气泡文字色,保证深色背景下可读。用户气泡内的行内代码使用现有半透明叠色 token 和气泡文字色,避免固定灰底与主题脱节。本次涉及两个前端组件及其颜色适配;正文排版优化留待后续 PR。
验证:
mise run lint通过(UI contract、全量 ESLint、Go lint);最终颜色适配后重新通过相关 ESLint 与 UI contract。go test ./...通过。vue-tsc未通过:基线与本次改动均为相同的 446 条类型错误(比较时忽略行号变化),无新增错误。http://127.0.0.1:8093,代理现有 OSS 后端http://localhost:18080;首页与/api/ping可达。