fix(webui): align ordered list markers

This commit is contained in:
Xubin Ren 2026-07-27 21:36:49 +08:00
parent 9b5a5c5302
commit 9c6e1b073f
2 changed files with 23 additions and 1 deletions

View File

@ -642,7 +642,9 @@ export default function MarkdownTextRenderer({
<li
className={cn(
itemClassName,
taskItem && "flex min-w-0 items-start gap-2 text-[13px] leading-5 [&>p]:m-0",
taskItem
? "flex min-w-0 items-start gap-2 text-[13px] leading-5 [&>p]:m-0"
: "[&>p]:inline",
)}
>
{markdownChildren}

View File

@ -405,6 +405,26 @@ describe("MarkdownTextRenderer", () => {
expect(screen.queryByRole("button", { name: /tasks/i })).not.toBeInTheDocument();
});
it("keeps loose ordered-list titles beside their markers", () => {
const { container } = render(
<MarkdownTextRenderer streaming>
{
"1. **一个约 16 MB 的 CLI 可执行文件**\n - `~/.local/bin/inferencesh`\n - `belt` 和 `infsh` 只是指向它的软链接。\n\n2. **登录凭据文件**\n - `~/.inferencesh/config.json`\n - 权限是 `600`。\n\n3. **Shell PATH 配置**\n - `.zshrc`"
}
</MarkdownTextRenderer>,
);
const items = container.querySelectorAll("ol > li");
expect(items).toHaveLength(3);
expect(items[0]).toHaveClass("[&>p]:inline");
expect(items[0].firstElementChild).toHaveTextContent(
"一个约 16 MB 的 CLI 可执行文件",
);
expect(items[0].querySelector("ul")).toHaveTextContent(
"~/.local/bin/inferencesh",
);
});
it("renders GFM tables in a responsive data surface", () => {
const { container } = render(
<MarkdownTextRenderer>