mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-04 08:28:36 +00:00
fix(webui): align ordered list markers
This commit is contained in:
parent
9b5a5c5302
commit
9c6e1b073f
@ -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}
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user