Skip to content

Chat markdown does not render TeX \(...\) / \[...\] or single-dollar math #239

Description

@exAClior

Before filing

Closest existing issue

none found

Split from the same session as a second, independent display bug: when $$ / fenced math do parse, a garbled plaintext copy still appears. Filed separately.

What's broken

Chat markdown does not render TeX-style \(...\) / \[...\] or single-dollar $...$ as math. Those stay literal (and \( / \[ lose the backslash). Double-dollar and fenced math do parse; that path has a separate display bug.

Steps to reproduce

  1. Launch Berd 0.6.2.
  2. New chat. Goose, Grok 4.6 via xAI (xai_oauth). No prior history needed; this is renderer behavior.
  3. Have the assistant emit (or otherwise display) these in one message:
    • inline TeX: \( \Omega \)

    • display TeX:

      \[
      \Omega = \sum_{n=1}^{\infty} \frac{1}{n^2}
      \]
      
    • spaced single-dollar: $ \Omega $

    • tight single-dollar: $\Omega$

  4. Compare to $$\Omega$$, a $$ display block, and a fenced math block in the same message.

What you expected to happen

\(...\), \[...\], and $...$ render as math, the way common model output is written (Anthropic/TeX vs OpenAI-style delimiters).

What actually happened

From a screenshot of the live bubble:

  1. \( \Omega \) rendered as ( Ω ) — backslash eaten, not math.
  2. \[ ... \] rendered as [ Ω = \sum_{n=1}^{\infty} \frac{1}{n^2} ] — same, not math.
  3. $ \Omega $ stayed literal $ Ω $.
  4. $\Omega$ stayed literal $\Omega$.
  5. $$\Omega$$, a $$ display block, and fenced math did become KaTeX (those still show a garbled duplicate; separate issue).

How often does it happen?

Every time — reliably reproducible

Berd version

0.6.2

Operating system

macOS (Apple Silicon)

Model and provider

Grok 4.6 via xAI (Goose / xai_oauth). Renderer-side; any model that emits these delimiters should hit it.

Relevant log output

no relevant log output

Looked at ~/Library/Logs/xyz.block.berd/berd.log around the turn. Nothing about KaTeX / math / Streamdown.

Screenshots, recordings, or other context

Screenshot of this session’s live delimiter matrix (same capture as the companion issue):

Chat bubble showing TeX and single-dollar math staying literal, while $$ and fenced math parse

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