From 11b137f9c0145fb5a953e225119feb2059e099f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 4 Sep 2026 13:21:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=97=E8=A1=A8=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E4=B8=8E=E5=86=85=E5=AE=B9=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免消息保留空白规则把列表项内容推到下一行 补充有序列表同行显示断言 --- .../src/components/ChatMarkdownMessage/index.tsx | 2 +- apps/ai-game-creator-shell/tests/ChatMarkdownMessage.test.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx b/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx index 39926feee..02a9f3d8a 100644 --- a/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx +++ b/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx @@ -93,7 +93,7 @@ function MarkdownListItem({ children }: { children?: ReactNode }) { const listKind = useContext(ListKindContext); return ( -
  • +
  • {listKind === 'unordered' ? '- ' : null} {children}
  • diff --git a/apps/ai-game-creator-shell/tests/ChatMarkdownMessage.test.tsx b/apps/ai-game-creator-shell/tests/ChatMarkdownMessage.test.tsx index 43f4a9bde..30eac0d09 100644 --- a/apps/ai-game-creator-shell/tests/ChatMarkdownMessage.test.tsx +++ b/apps/ai-game-creator-shell/tests/ChatMarkdownMessage.test.tsx @@ -50,6 +50,7 @@ describe('ChatMarkdownMessage', () => { expect(items[0]?.textContent?.trim()).toBe('第一件事'); expect(items[1]?.textContent?.trim()).toContain('第二件事'); expect(items[0]?.querySelector('p')?.className ?? '').toContain('inline'); + expect(items[0]?.className).toContain('whitespace-normal'); expect(items[0]?.textContent).not.toContain('-'); });