tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks

Open Beginner friendly
#66,773 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@argszero is already working on this.

Since Nov 27, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

Start in packages/merman/src/core/text-lines.ts and read parseDiagramTextLines, which currently splits on <br> tags and parses italic tags. Trace how Mermaid node labels reach this parser, then check the TUI rendering tests for text lines. Done when bold tags are handled and \n creates separate lines in the rendered labels.

Written by the indexing model from the issue text.

Description

area/tui platform/wsl status/repro-simulated type/bug version/v2
Description

In the TUI Mermaid renderer (packages/merman), HTML bold tags (<b>, <strong>) inside node labels are rendered literally instead of being formatted as bold (or stripped), and \n line breaks are not split into multiple lines.

Looking at packages/merman/src/core/text-lines.ts, parseDiagramTextLines only splits lines on <br>/<br/> and only parses <i>/<em> tags:

export function parseDiagramTextLines(value: string): DiagramTextLine[] {
  return value.split(/<br\s*\/?>/i).map((line) => {
    const runs: DiagramTextRun[] = []
    const source = line.trim()
    const tag = /<\/?(?:i|em)\s*>/gi
Plugins

None

OpenCode version

v2.1.2

Steps to reproduce
  1. Render a Mermaid flowchart in the TUI containing <b> / <strong> tags and \n line breaks in node labels:
```mermaid
flowchart TD
  A["<b>Service A</b>\nLine 2"] --> B["<strong>Service B</strong><br/>Line 2"]
```
  1. Observe that <b>Service A</b> and <strong>Service B</strong> are displayed with literal HTML tags and \n does not break the line.
Screenshot

N/A

Operating System

Linux (WSL2 - 6.18.33.2-microsoft-standard-WSL2)

Terminal

herdr

Dominant language
TypeScript
Stars
228k
Forks
31k
Avg merge
5h 19m
Merged PRs (30d)
457

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.