Skip to content

[Bug] Markdown CJK wrap duplicates glyph at specific widths #799

@stephanoskomnenos

Description

@stephanoskomnenos

Summary

Rendering Markdown with CJK content can duplicate a fullwidth glyph at specific terminal widths where the line wraps.

Repro

Repo: https://github.com/stephanoskomnenos/opentui-md-wrap-demo

Commands:

  • scripts/capture.sh --tmux-columns 38 --out-png ./tmp/demo-38.png
  • scripts/capture.sh --tmux-columns 39 --out-png ./tmp/demo-39.png
  • scripts/capture.sh --tmux-columns 40 --out-png ./tmp/demo-40.png

Expected

No duplicated glyph on wrap.

Actual

At width 39, the wrap boundary duplicates a CJK glyph ("确" appears both at end of line and again on next line).

Screenshots (38/39/40)

38
39
40

ANSI/HTML/PNG are included in the repo under tmp/.

Environment (devcontainer)

  • @opentui/core: 0.1.87
  • @opentui/react: 0.1.87
  • Bun runtime (Linux)
  • Rendering via <markdown> component

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreThis relates to the core package

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions