Skip to content

Commit 144fb9a

Browse files
authored
feat(core): improve Word and Google Docs paste handling (#3226)
1 parent 77a64da commit 144fb9a

5 files changed

Lines changed: 1384 additions & 1 deletion

File tree

‎docs/content/docs/reference/editor/paste-handling.mdx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ BlockNote, by default, attempts to paste content in the following order:
2121

2222
You can change the default paste behavior by providing a custom paste handler, which will give you full control over how pasted content is inserted into the editor.
2323

24+
## Word and Google Docs
25+
26+
BlockNote automatically converts Microsoft Word list paragraphs into nested lists,
27+
removes Word paragraph-end placeholders, and preserves blank paragraphs copied from
28+
Google Docs. This applies to external HTML pasted from the clipboard.
29+
30+
This is a best-effort conversion into BlockNote's block types, not exact source
31+
formatting preservation. Unsupported list labels, such as `iv.` or `1.2.`, stay as
32+
text instead of being removed.
33+
34+
To replace this behavior, use a custom `pasteHandler` and handle the HTML before
35+
calling `editor.pasteHTML`. Calling `defaultPasteHandler` keeps the built-in
36+
normalization. Internal BlockNote clipboard content bypasses this normalization.
37+
2438
## `pasteHandler` option
2539

2640
The `pasteHandler` option is a function that receives the following arguments:

0 commit comments

Comments
 (0)