feat(autolink): render <URL> inline and embed user-attachments media#13
Merged
Conversation
CommonMark autolink (`<https://example.com>`) was leaving literal `<` and `>` in the rendered output because process_bare_urls excluded them from its URL regex. Inline autolinks now strip the brackets and register the URL as a clickable link, with the same long-URL truncation as bare URLs. Standalone `<URL>` lines pointing at GitHub's user-attachments CDN (`https://github.com/user-attachments/...`) now route through the image pipeline, mirroring github.com's behavior of inlining these as `<video>`/`<img>` based on Content-Type. The existing download_async + magic-byte detection + ffprobe path handles the actual media rendering. Restricted to that CDN so non-media URLs do not get stuck on a "Loading..." placeholder. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
delphinus
added a commit
that referenced
this pull request
May 15, 2026
image_placements are only registered when image.supports_kitty() returns true, which requires a Kitty graphics-capable terminal (WezTerm/kitty/ghostty). CI runners report false, so the standalone autolink tests added in #13 failed there even though the routing logic itself is correct. Stub image.supports_kitty for the duration of these tests with a restore-on-error wrapper. The negative test is also stubbed so it exercises the URL filter rather than passing for the wrong reason (no placement because no kitty support). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<https://example.com>) now strips the angle brackets in the rendered output and registers the URL as a clickable link (previously the brackets leaked through as literals).<URL>line pointing at GitHub'suser-attachmentsCDN is routed through the image pipeline so it inlines as video/image — same behavior as github.com. Existingdownload_async+ magic-byte detection +ffprobehandles the actual rendering. Restricted to that CDN to avoid stuck "Loading..." placeholders for non-media URLs.Test plan
make test(515 passed, 0 failed; +5 new autolink tests intests/link_types_test.lua)~/.local/share/nvim/lazy/undo-glow.nvim/README.md(which has 19<https://github.com/user-attachments/assets/...>lines): all 19 register as image_placements withsrc_urlpopulated:MdRenderin a Kitty-graphics-capable terminal and confirm the videos play🤖 Generated with Claude Code