Skip to content

Comments

feat(tui): make markdown links clickable via OSC 8 hyperlinks#606

Merged
bug-ops merged 2 commits intomainfrom
feat/580-tui-markdown-links
Feb 19, 2026
Merged

feat(tui): make markdown links clickable via OSC 8 hyperlinks#606
bug-ops merged 2 commits intomainfrom
feat/580-tui-markdown-links

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 19, 2026

Summary

  • Collect (display_text, url) pairs during pulldown-cmark rendering in MdRenderer
  • Merge markdown link spans with regex-detected bare URLs in a single-pass buffer scan
  • Cache md_links in RenderCacheEntry to avoid re-parsing on every frame
  • Sanitize URLs: strip ASCII control chars before OSC 8 write, reject non-http(s) schemes
  • Use char-indexed search for correct non-ASCII link text handling

Test plan

  • [text](url) renders as clickable OSC 8 hyperlink with text as display
  • Bare URLs remain clickable as before
  • Nested markdown formatting inside links preserved ([**bold**](url))
  • Empty link text [](url) produces no hyperlink
  • javascript: / data: / file: schemes rejected
  • OSC 8 escape injection blocked (control chars stripped)
  • Non-ASCII link text (CJK) handled via char-indexed search
  • 1934/1934 tests pass, 10 new tests added

Closes #580

@github-actions github-actions bot added enhancement New feature or request size/L rust and removed enhancement New feature or request labels Feb 19, 2026
Collect (display_text, url) pairs during pulldown-cmark rendering and
merge them into the hyperlink system alongside regex-detected bare URLs.

- Add MdLink struct to capture markdown link metadata in MdRenderer
- Propagate md_links through render pipeline and cache them in RenderCacheEntry
- Single-pass buffer scan in collect_from_buffer_with_md_links merging
  bare URL regex matches with markdown link spans (dedup on overlap)
- Sanitize URLs: strip ASCII control chars before OSC 8 write, reject
  non-http(s) schemes from markdown links
- Use char-indexed search for correct non-ASCII link text handling
@bug-ops bug-ops force-pushed the feat/580-tui-markdown-links branch from bf57dde to 1bdc303 Compare February 19, 2026 14:37
@github-actions github-actions bot added enhancement New feature or request size/XL and removed size/L labels Feb 19, 2026
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 19, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 19, 2026 14:48
@bug-ops bug-ops merged commit f36c20b into main Feb 19, 2026
22 checks passed
@bug-ops bug-ops deleted the feat/580-tui-markdown-links branch February 19, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request rust size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI: make markdown links clickable via OSC 8 hyperlinks

1 participant