修复列表编号与内容换行
避免消息保留空白规则把列表项内容推到下一行 补充有序列表同行显示断言
This commit is contained in:
@@ -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('-');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user