[PR #607] [MERGED] feat(core): add OSC 8 hyperlink metadata to markdown links #654

Closed
opened 2026-03-02 23:47:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/607
Author: @cevr
Created: 2/1/2026
Status: Merged
Merged: 2/2/2026
Merged by: @kommander

Base: mainHead: feat/markdown-osc8-links


📝 Commits (1)

  • 03c9ec5 feat(core): add OSC 8 hyperlink metadata to markdown link/image chunks

📊 Changes

2 files changed (+110 additions, -25 deletions)

View changed files

📝 packages/core/src/renderables/Markdown.ts (+35 -25)
📝 packages/core/src/renderables/__tests__/Markdown.test.ts (+75 -0)

📄 Description

Summary

  • Set link: { url } on TextChunks for markdown link and image tokens, enabling OSC 8 terminal hyperlinks
  • Thread optional link parameter through createChunk and renderInlineTokenWithStyle — backwards-compatible, no new methods
  • All link/image chunk text (label, URL, punctuation) carries the href so the entire rendered span is clickable

The rendering infrastructure (textBufferSetStyledTextlinkAlloc → zig \x1b]8;;URL\x1b\\) was fully wired. The only missing piece was Markdown.ts never populating chunk.link.

Test plan

  • Link chunks carry link.url with conceal=true
  • Link chunks carry link.url with conceal=false
  • Image chunks carry link.url
  • Non-link text has no link metadata
  • Manual: verify Cmd+click opens URLs in iTerm2/Kitty/WezTerm

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/607 **Author:** [@cevr](https://github.com/cevr) **Created:** 2/1/2026 **Status:** ✅ Merged **Merged:** 2/2/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `feat/markdown-osc8-links` --- ### 📝 Commits (1) - [`03c9ec5`](https://github.com/anomalyco/opentui/commit/03c9ec5866bc58ac535c7400bdfddac637b3dffb) feat(core): add OSC 8 hyperlink metadata to markdown link/image chunks ### 📊 Changes **2 files changed** (+110 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/Markdown.ts` (+35 -25) 📝 `packages/core/src/renderables/__tests__/Markdown.test.ts` (+75 -0) </details> ### 📄 Description ## Summary - Set `link: { url }` on `TextChunk`s for markdown link and image tokens, enabling OSC 8 terminal hyperlinks - Thread optional `link` parameter through `createChunk` and `renderInlineTokenWithStyle` — backwards-compatible, no new methods - All link/image chunk text (label, URL, punctuation) carries the href so the entire rendered span is clickable The rendering infrastructure (`textBufferSetStyledText` → `linkAlloc` → zig `\x1b]8;;URL\x1b\\`) was fully wired. The only missing piece was `Markdown.ts` never populating `chunk.link`. ## Test plan - [x] Link chunks carry `link.url` with `conceal=true` - [x] Link chunks carry `link.url` with `conceal=false` - [x] Image chunks carry `link.url` - [x] Non-link text has no `link` metadata - [ ] Manual: verify Cmd+click opens URLs in iTerm2/Kitty/WezTerm 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:32 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#654
No description provided.