Repository navigation
Link with custom protocoll does not work #4356
Description
Activity
Reproduced on macOS (Apple Silicon) against the latest
develop(64e590c), so this is not Windows-specific. Steps: open a document containing[sambesi://localhost/node/11164](sambesi://localhost/node/11164), hover the link, and click the jump button in the popover — the renderer throws the sameTypeError: Cannot read properties of null (reading 'length')inFORMAT_LINK_CLICK.Root cause: muya's
sanitizeHyperlink(DOMPurify's protocol allowlist) strips thesambesi://href at render time, so the link popover captureshref: null, and the jump handler forwards that toFORMAT_LINK_CLICK, which readdata.href.lengthwithout a guard.There are two separate things in this issue:
-
The crash — fixed in fix: #4356 crash when using the link popover on a link with an unsupported protocol #4473: the popover no longer offers "jump" when there is no usable href, and the store guards null defensively.
-
Custom protocols not opening at all — this appears deliberate and predates the engine rewrite: the main-process
mt::format-link-clickhandler only openshttp(s)URLs and explicitly swallows other schemes (// Prevent other URLs.inpackages/desktop/src/main/menu/actions/file.ts). Opening arbitrary schemes viashell.openExternalis a real security surface, so I left that behavior unchanged in the PR. If supporting custom protocols (perhaps behind a confirmation prompt or a preference) is wanted, I would be happy to work on it as a follow-up once there is maintainer guidance on the desired approach.
Reacted by Ran LuoReacted by Ran Luo-
For maintainers triaging this: there are now two open PRs on this issue with different scopes. #4416 (earlier) proposes actually opening custom-protocol links via
shell.openExternalwith a denylist of unsafe schemes. My #4473 is narrower — it only fixes the crash (the popover stops offering "jump" when the sanitizer stripped the href, plus a null guard in the store) and deliberately leaves the existing http(s)-only policy unchanged, treating "should custom schemes open at all" as a maintainer decision. The two PRs conflict textually (both touchstore/editor.tsand addtest/e2e/issue-4356.spec.ts), so whichever direction is preferred, I'm happy to rebase or adapt mine.Reacted by Ran LuoMany thanks to @FurkaanBoraa for investigating and fixing the issue. #4414 still seems to be in draft state. I will review it together once this PR is ready.
- added 2 commits that reference this issue
on Jun 17, 2026 - added a commit that references this issue
on Jun 21, 2026 - added a commit that references this issue
on Jul 30, 2026
Description
Link with custom protocoll does not work
Minimal Reprouducible Markdown Example (or Steps)
For example
Stack Trace
Version
MarkText: v0.19.0
Operating system: Windows_NT x64 10.0.26200 (win32)