diff --git a/components/md-blocks.tsx b/components/md-blocks.tsx index c55a5e6..4d5d162 100644 --- a/components/md-blocks.tsx +++ b/components/md-blocks.tsx @@ -338,8 +338,26 @@ export function MathDisplay(props: ComponentProps<"span"> & ExtraProps) { // ─── The stable override set (module identity: Streamdown is memoized) ──────── +/** Bold as the REAL element (appearance fix, 2026-09-23): streamdown's + * default `strong` renders `` — and `.lh-prose :where(strong, b)` matches strong/b + * ELEMENTS, so neither the factory ink (#c96b4a) nor a settings + * boldColor ever landed on bold text (italic worked: streamdown leaves + * `em` native). Rendering the semantic element restores screen-reader + * emphasis AND lets the designed token rule apply unmodified — color + * --lh-ink-strong, weight 700 (beating the old 600 utility). */ +export function MarkdownStrong(props: ComponentProps<"strong"> & ExtraProps) { + const { children, className, node, ...rest } = props; + return ( + + {children} + + ); +} + export const mdComponents = { code: MarkdownCode, table: MarkdownTable, span: MathDisplay, + strong: MarkdownStrong, }; diff --git a/tests/render-markdown.test.tsx b/tests/render-markdown.test.tsx index 444c62d..a968eb6 100644 --- a/tests/render-markdown.test.tsx +++ b/tests/render-markdown.test.tsx @@ -212,3 +212,31 @@ describe("render — mermaid", () => { assert.match(html, />Retry (the dead Bold-color fix)", () => { + // Streamdown's default `strong` renders — and the app's ink token rule + // (.lh-prose :where(strong, b), globals.css) matches strong/b + // ELEMENTS, so bold never took the --lh-ink-strong color (neither the + // factory #c96b4a nor a settings boldColor). The mdComponents override + // renders the semantic element. + it("bold renders a real element inside .lh-prose", () => { + const html = render("plain **bold** plain"); + assert.ok( + html.includes('bold'), + "bold renders as a semantic strong element", + ); + assert.ok(html.includes("lh-prose"), "the markdown surface carries .lh-prose (the token rule's anchor)"); + }); + + it("no span-for-bold regression: the font-semibold span is gone", () => { + const html = render("plain **bold** plain"); + assert.ok(!html.includes('class="font-semibold"'), "streamdown's span/600 default must not render bold"); + }); + + it("italic stays native (the case that always worked)", () => { + const html = render("plain *emph* plain"); + assert.ok(html.includes(""), "italic renders a native em element"); + }); +});