Skip to content

bug(ui): markdown heading markers (###) shown verbatim in quote chips render as cramped literal text #2213

Description

@cat0825

What happened

A quote chip / file-reference strip in the chat surface shows markdown source
verbatim, including heading markers:

…/path/to/issue.md ### Description

The three # characters render as literal text at small size, and the dense
# strokes read as a cramped/overlapping blob instead of three distinct
hashes.

Banner with literal ### (path redacted)

### segment close-up

For reference, the same string rendered locally with the system font stack at
13pt medium is clearly spaced — the cramped look comes from displaying the
markdown marker as plain text in the chip, not from font shaping:

Reference rendering of "### Description"

Root cause (verified at source level — not a markdown parse bug)

The markdown pipeline in this build (@astryxdesign/core, packaged as
markdown-body-*.js) parses ATX headings with:

let n = e.match(/^(#{1,6}) +(.*)/);
if (n) { c.push({type:'heading', level:n[1].length, children:W(n[2], o)}), l++; continue }

The regex anchors the markers at line start (^). Running the exact packaged
parse logic:

".analysis/issue-new-messages.md ### Description"  → NO MATCH → "###" kept as literal text
"### Description"                                  → MATCH   → heading level 3, markers consumed

So the renderer is correct per CommonMark: mid-line ### is not a heading
marker and is emitted as plain text. The problem is presentation-only: quoted
excerpts preserve markdown source (use-message-selection-quote.ts captures
selection.toString().replace(/\s+/g,' ').trim() verbatim), so ### can
land in a chip and render as cramped literal hashes.

Full evidence trail from the shipped build:

  • 154 renderer chunks + 5 main bundles + full @astryxdesign/core source
    (1987 files): no code path emits # characters as a level badge; no
    "###" literal, no "#".repeat, no CSS content:"#...".
  • Font stack is the system default (-apple-system, BlinkMacSystemFont, ...);
    no custom font-feature or negative letter-spacing involved.

Suggested fixes (any of)

  1. When building a quote/chip from a markdown document, strip heading markers
    (^#{1,6} "") so the chip shows Description instead of
    ### Description.
  2. Keep the source verbatim but render literal # runs with explicit
    letter-spacing (or a code/monospace style) so three hashes never look
    merged.
  3. Audit other surfaces that show markdown source as plain text (file
    reference previews, raw-source views) for the same verbatim-marker display.

Environment

  • App: Maka desktop 0.1.5 (Electron, macOS Apple Silicon)
  • Surface: chat / quote reference strip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions