Skip to content

feat: open on-disk markdown links in the editor - #62

Open
RichardHightower wants to merge 2 commits into
mainfrom
feat/note-links
Open

RichardHightower wants to merge 2 commits into
mainfrom
feat/note-links

Conversation

@RichardHightower

Copy link
Copy Markdown
Contributor

Summary

01M3M9CAJ08DJKX7T6E0EE8SP3

Click a link in the editor and, if it points at a markdown file on disk, Motion opens that note.

  • Relative to the current note, then the folder root (getting-started.md, nested/deeper.md, ../welcome.md)
  • Optional .md, folder links open README.md or index.md
  • file:// and absolute paths inside the folder
  • On the Mac app, an absolute markdown path outside the folder opens that file's folder. Browser mode cannot switch workspace.
  • Web links are not loaded as notes
  • A miss does not navigate the webview away
  • TipTap's default URI check was dropping dir/note.md. That check is replaced so those links stay links.

Test plan

  • bun run typecheck
  • bun run guard:client
  • bun test src (noteLink.test.ts)
  • CI=1 playwright test e2e/links.spec.ts — 3 passed (sibling, nested, missing)
  • Mac dogfood: absolute link outside the open folder switches workspace

01M3M9CAJ08DJKX7T6E0EE8SP3

Clicking a link loads that note when the href is a markdown file in the
open folder. Directory paths like nested/note.md survive TipTap's URI
check. A miss does not navigate the window away. Web links stay web links.
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.

1 participant