Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ and this project adheres to
- 🚸(frontend) redirect on current url tab after 401 #2197
- 🐛(frontend) abort check media status unmount #2194
- ✨(backend) order pinned documents by last updated at #2028
- 🐛(frontend) sanitize pasted toolbar links #2214

### Changed

- ♿️(frontend) structure correctly 5xx error alerts #2128
- ♿️(frontend) structure correctly 5xx error alerts #2128

## [v4.8.6] - 2026-04-08

### Added

- 🚸(frontend) allow opening "@page" links with
ctrl/command/middle-mouse click #2170
- 🚸(frontend) allow opening "@page" links with
ctrl/command/middle-mouse click #2170
- ✅ E2E - Any instance friendly #2142

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,32 @@ interface BlockNoteEditorProps {
provider: HocuspocusProvider;
}

/**
* Strips angle brackets wrapping URLs (e.g. `<https://example.com>` → `https://example.com`).
* BlockNote copies links in Markdown autolink format; pasting into the link
* toolbar input keeps the brackets, producing broken hrefs.
*/

const handlePasteUrlBrackets = (e: React.ClipboardEvent<HTMLDivElement>) => {
const target = e.target;
if (
!(target instanceof HTMLInputElement) &&
!(target instanceof HTMLTextAreaElement)
) {
return;
}
const text = e.clipboardData?.getData('text/plain') ?? '';
const cleaned = text.replace(/^\s*<([^<>]+)>\s*$/, '$1');
if (cleaned === text) {
return;
}
Comment thread
Ovgodd marked this conversation as resolved.
e.preventDefault();
const start = target.selectionStart ?? target.value.length;
const end = target.selectionEnd ?? target.value.length;
target.setRangeText(cleaned, start, end, 'end');
target.dispatchEvent(new Event('input', { bubbles: true }));
Comment thread
Ovgodd marked this conversation as resolved.
};

export const BlockNoteEditor = ({ doc, provider }: BlockNoteEditorProps) => {
const { user } = useAuth();
const { setEditor } = useEditorStore();
Expand Down Expand Up @@ -267,6 +293,7 @@ export const BlockNoteEditor = ({ doc, provider }: BlockNoteEditorProps) => {
return (
<Box
ref={refEditorContainer}
onPasteCapture={handlePasteUrlBrackets}
$css={css`
${cssEditor};
${cssComments(showComments, currentUserAvatarUrl)}
Expand Down
Loading