Markdown
ui.widgets.Markdown把受支持的 Markdown 子集渲染为原生节点。Renders a supported Markdown subset as native nodes.
BEHAVIOR CONTRACT
heading、强调、inline code、列表和引用生成真实可布局文本节点。Headings, emphasis, inline code, lists and quotes become real layout text nodes.
RECORDED INTERACTION
录像展示标题、粗体、斜体、列表与引用。Shows headings, bold, italic, lists and quotes.
// ── Markdown ──
pub fn buildMarkdown(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
_ = scope;
const md =
\\# Markdown
\\
\\Supports **bold**, *italic*, and `inline code`.
\\
\\- bullet one
\\- bullet two
\\
\\> A blockquote line.
;
const res = try W.Markdown(md, .{ .base_font_size = 13 }).render(cx);
return res.root;
}这是 Storybook 中该 story 的原样代码(zenit 5f9add5+wip 2026-09-30)。其中 W 即 ui.widgets,col / row / label 是 Storybook 内的布局小工具。The story's verbatim source from the Storybook (zenit 5f9add5+wip 2026-09-30). W is ui.widgets; col / row / label are small Storybook layout helpers.