You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Repository-relative links open as https://<path> #760
Repository-relative links in a document, such as [review](docs/review.md), open as https://docs/review.md.
The dialect accepts these links (disguisedUrl only refuses relative paths that leave the repository), and the link editor offers "a path in this repository". But nothing resolves them against the document's repository:
Lexical 0.48's LinkNode.createDOM sets href from sanitizeUrl, which calls formatUrl. formatUrl prefixes https:// to anything that doesn't start with a scheme, /, . or #, so docs/review.md becomes https://docs/review.md.
follow in packages/editor/src/toolbar/link.tsx opens that href. A ./docs/review.md link would instead resolve against the Chopin page URL.
The Planner writes these links itself when it cites repository files, so most documents that reference code have broken links.
Expected: a repository-relative link opens https://github.com/{owner}/{repo}/blob/{default branch}/{path}, for example by overriding sanitizeUrl in a Chopin link node, or by resolving the path before it reaches Lexical.
Seen at e47b1a5. Changing the links through MCP update_document is also refused until the edited passages get new visuals, so the practical workaround is asking the Planner to use full GitHub URLs.
The fix is up in #788: a repository-relative link now opens the file on GitHub at the document's branch, in the editor, read-only views and Chat. A link that climbs out of the repository is refused.
Activity
alexgnq commentedon Nov 2, 2026
I'm glad to work on implementing this as well, if that helps.
lavaman131 commentedon Nov 5, 2026
Thanks for offering @alexgnq, and for tracking it down to
formatUrl. I've got this one covered, and I'll link the PR here when it's up.lavaman131 commentedon Nov 5, 2026
The fix is up in #788: a repository-relative link now opens the file on GitHub at the document's branch, in the editor, read-only views and Chat. A link that climbs out of the repository is refused.
Open a repository-relative link as the file on GitHub
Refuse a repository link that climbs out of the repository
Refuse a repository link that climbs out of the repository
Open a repository-relative link as the file on GitHub