Skip to content

fix(editor): click links only on visible label text - #72

Merged
chasehuh merged 1 commit into
mainfrom
fix/link-click-label-only
Aug 3, 2026
Merged

fix(editor): click links only on visible label text#72
chasehuh merged 1 commit into
mainfrom
fix/link-click-label-only

Conversation

@chasehuh

@chasehuh chasehuh commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Full-node hit-testing made the click target feel too wide (list markers / neighboring text / hidden URL span).
  • Clickable range is now the visible label (and bare URL text); handlers also require the event target to be inside .cm-md-link, with posAtDOM fallback when coords land in the replaced URL.

Test plan

  • pnpm exec vitest run lib/editor/links.test.ts
  • Manual: click only the link label opens; clicking beside it does not

Made with Cursor

Narrow hit-testing to the painted `.cm-md-link` mark (label / bare URL)
instead of the whole `[label](url)` node, so neighboring text no longer
triggers navigation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview Aug 3, 2026 12:24am

Request Review

@chasehuh
chasehuh merged commit 49db95a into main Aug 3, 2026
2 checks passed
@chasehuh
chasehuh deleted the fix/link-click-label-only branch August 3, 2026 00:24
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