feat: add link embeds and mentions to editor - #140
Merged
Conversation
Reddit blocks HTML scrapers aggressively, so use their public JSON API with old.reddit.com fallback. Also expands bot page title detection for verification pages.
url-metadata.ts provides extractDomain and cached fetchLinkPreview. youtube-utils.ts re-exports shared extractor with thumbnail/embed URLs. Delegates inbox-utils extractDomain to url-metadata.
Rich inline link chip with favicon, domain, and title. Renders as clickable pill, parses from both data attributes and markdown mention format. Includes CSS for .link-mention styling.
Custom BlockNote block renders click-to-play YouTube player. Markdown serializes as \ and parser splits by embed markers to reconstruct blocks.
When pasting a URL, shows a popover to choose: plain URL, rich mention, or embed (for YouTube). Supports keyboard navigation and click-away dismiss.
Add frame-src youtube-nocookie.com, broaden img-src to https: for favicons/thumbnails, and scope CSP header injection to own pages only so external resource responses aren't broken.
Register linkMention + youtubeEmbed in editor schema. Wire paste link menu handlers in ContentArea for mention/embed conversion. Hydrate link mention favicons on document load via use-editor-sync.
Replace [Open Original](url) with rich mention format for links and \ for YouTube when filing inbox items to notes. Updates tests to match new output format.
Click-to-play YouTube embed in inbox detail view with play button overlay. Hides excerpt and domain bar for YouTube items to keep the UI focused on the video.
h4yfans
added a commit
that referenced
this pull request
May 6, 2026
feat: add link embeds and mentions to editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add YouTube embed blocks, link mentions, and a paste-link menu to the BlockNote editor with full inbox link preview support.
Why
Users paste URLs frequently in notes. Instead of raw links, this adds rich inline previews — YouTube embeds play inline, link mentions show metadata, and the paste menu lets users choose the format (plain URL, mention, or embed).
How
<iframe>player, markdown round-trip viasyntaxframe-src https://www.youtube.comfor iframe embedsextractYouTubeVideoId()inpackages/sharedfor cross-package reuseType
feat— new featureTest plan
Manual: pasted YouTube/Reddit/generic URLs in editor, verified embed rendering, markdown round-trip, inbox link previews, paste menu behavior.
Checklist