Repository navigation
Conversation
Markdown links with spaces in the destination are recognized, with or without angle brackets, and titles are dropped from the target. A dead link offers to create the note where it points, so the link resolves once the note exists. Hrefs that name a file or leave the vault still report "Not a note". A #heading or ^block anchor now lands on its target, on Markdown links and wikilinks alike, in the editor and in reading mode. Same-note anchors jump instead of offering a note with an empty name. Bare domains such as google.com open in the browser.
adibhanna
merged commit Nov 3, 2026
03f633d
into
claude/fix-autosave-undo-gd-b13126
4 of 5 checks passed
1 task
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.
Brings the rest of
gdlink following in line with the desktop app, whose source is the spec. Stacked on #32, which addsvault.ResolveNoteHref. Merge that first; this PR's diff shows only the link work.What changes
[a](<./My Note>)was "No link under the cursor". The editor now reads links like the desktop'sLINK_SHAPES: spaces with or without angle brackets, a)inside angle brackets, and"title"or'title'dropped. Reading mode stays stricter, as the desktop's renderer is: spaces need angle brackets to count as a link.Create note "Work/My Note"?and creates the note on yes. Hrefs that name a file, climb out of the vault, use another scheme or hold characters a note name cannot have still say "Not a note".#heading(text, percent-encoded or slug),^blockand#^blocknow land on their target with it at the top of the view, on Markdown links and wikilinks, in the editor and in reading mode. A missing anchor opens the note where it was.[a](#Heading),[[#Heading]]and[[^id]]jump inside the note; the wikilink forms used to offer a note with an empty name.[site](google.com)openshttps://google.com, a port ofexternalLinkUrl. As on the desktop,Note.mdandphoto.pngstay local, and so a bare[a](v1.2)goes to the browser even if a note has that name, while./v1.2stays a note.Where this differs from the desktop on purpose
/./My Note.mdfor./My Note, which its ownparseCreateNotePathrejects, and it puts a bare name in the Inbox. A path from the vault root (/Top/New) starts at the Inbox, as on the desktop.a.confirm, like the existing wikilink branch.followLinkTarget) and what zn v0.15.0: undo cannot wipe a note, autosave can be off, gd follows links like the desktop #32 chose; the desktop'sgdtries the name first, so the two can differ when a note elsewhere has the same title.Changes to code from #32
TestFollowLinkReportsLinksItCannotOpenloses its"missing note"case, since that message is gone.TestDeadRelativeLinkOffersTheNotecovers the new behavior.NoteHrefPathis extracted fromResolveNoteHref, with no change in behavior, so the create offer can use it.Not in this PR
Still different from the desktop: vault attachments and files outside the vault from a Markdown link, gating of application schemes (any
://link goes to the system opener with no question), periodic notes from a dead link,[[https://…]], and.basedatabases.Testing
go test ./...passes. New tests are ininternal/tui/links_follow_test.go,internal/vault/linkanchor_test.goandinternal/vault/linkhref_test.go.openshim so no browser launched: angle-bracket links, a dead link declined and accepted, heading and block anchors, a bare domain, a same-note anchor, a wikilink heading, a file link and a link out of the vault. All were rerun on top of zn v0.15.0: undo cannot wipe a note, autosave can be off, gd follows links like the desktop #32.