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

Đang mở Phù hợp với người mới
#66,773 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@argszero đang làm issue này rồi.

Từ ngày 27/11/2026.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
228k
Fork
31k
Merge trung bình
5 giờ 19 phút
Pull request đã merge (30 ngày)
457

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.