Skip to content

fix(editor): open relative Markdown links as workspace files - #4020

Open
kev1n77 wants to merge 1 commit into
openBitFun:mainfrom
kev1n77:fmy/fix-3874-markdown-file-links
Open

kev1n77 wants to merge 1 commit into
openBitFun:mainfrom
kev1n77:fmy/fix-3874-markdown-file-links

Conversation

@kev1n77

@kev1n77 kev1n77 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3874.

  • Preserve relative file destinations such as references/workflow.md in the rich Markdown editor and resolve them from the source document's directory.
  • Open the destination through the existing file tab router using the document's workspace and device. Read-only documents use a normal click. Editable documents use Cmd/Ctrl-click so a regular click can place the caret.

Type and Areas

Bug fix in the shared Markdown editor for Desktop and Web.

Motivation / Impact

Tiptap's URL validator cleared some relative destinations. The remaining file links relied on browser navigation and resolved against the WebView URL.

Verification

  • Passed pnpm run check:web and pnpm run i18n:audit on the PR branch.
  • Passed 2,496 focused tests across the Markdown editor, renderer, and workbench on the PR branch.
  • Passed all 14 Markdown Chrome E2E cases before rebasing, and reran the relative-link click regression on the PR branch with pnpm --dir tests/e2e exec wdio run ./config/wdio.markdown-browser.ts --mochaOpts.grep 'opens relative Markdown links'. The test verifies both destination paths and the absence of browser navigation.
  • Simulated SSH and Peer Device ownership in the editor tests. Native Tauri and live remote hosts were outside local verification.

Reviewer Notes

AI-assisted and tested locally. The fix reuses the existing file tab route and requires no storage or protocol migration.

Checklist

  • The PR contains only the issue fix and its verification changes.
  • Local verification and its limits are recorded above.
  • User-facing copy is localized.

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.

[Bug]: 对文件的索引有问题

1 participant