Skip to content

Fix no-color Markdown URL targets (#729) - #731

Merged
justrach merged 2 commits into
mainfrom
fix/729-markdown-url-target
Sep 4, 2026
Merged

Fix no-color Markdown URL targets (#729)#731
justrach merged 2 commits into
mainfrom
fix/729-markdown-url-target

Conversation

@yxlyx

@yxlyx yxlyx commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes #729.

What changed

  • Render no-color assistant text through the same streaming Markdown boundary logic as colored output.
  • Settle complete URL tokens before interpreting inline delimiters, covering *, **, _, __, ~~, and backticks across arbitrary provider-delta splits.
  • Keep legal marker bytes intact when they belong to an unwrapped URL, including /**, /__, /~~, query asterisks, Python double-underscore anchors, and interior ** runs.
  • Linkify URLs inside parsed GUI emphasis and strikethrough nodes while keeping the clickable target exact.
  • Track whether an earlier emphasis delimiter is still open, so an already-closed span cannot truncate a later legal URL suffix.
  • Expand the real color/no-color PTY fixture and add table-driven GUI, streaming sink, and fullscreen TUI regressions.

Boundary contract

Markdown wrapper delimiters are presentation syntax and are excluded from the rendered URL. Surrounding brackets and sentence punctuation remain outside GUI link targets. The same characters are preserved byte-for-byte when they are part of an unwrapped URL. Explicit Markdown links continue to use their sanitized destination as the exact href.

Verification

  • zig build test — 1,913 passed, 1 skipped
  • zig build tui-test — 530 passed
  • Tier 1 pre-push suite — all 18 PTY probes passed
  • python3 scripts/test-pty-markdown.py zig-out/bin/graff — passed in color and no-color modes
  • python3 scripts/test-tui-stream-markdown.py zig-out/bin/graff — passed
  • bun test — passed
  • bunx tsc --noEmit --pretty false — passed
  • bun run lint — passed

@justrach
justrach merged commit 9494352 into main Sep 4, 2026
8 of 9 checks passed
@justrach
justrach deleted the fix/729-markdown-url-target branch September 4, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: rendered bare URLs include trailing ** in Cmd-click target on v0.0.284

2 participants