修复列表编号与内容换行

避免消息保留空白规则把列表项内容推到下一行
补充有序列表同行显示断言
This commit is contained in:
2026-09-04 13:21:58 +08:00
parent 397e321a88
commit 11b137f9c0
2 changed files with 2 additions and 1 deletions
@@ -93,7 +93,7 @@ function MarkdownListItem({ children }: { children?: ReactNode }) {
const listKind = useContext(ListKindContext);
return (
<ListItemContext.Provider value>
<li className="break-words">
<li className="break-words whitespace-normal">
{listKind === 'unordered' ? '- ' : null}
{children}
</li>
@@ -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('-');
});