How to insert a block (or how to insert a markdown?


Is me agian.

Now I wanna to insert a markdown content.

I use defaultMarkdownParser.parse to parse the markdown into a Node

But I found that tr.replaceSelectionWith method can insert a inline node but can not insert a block node.

Is that any methods can insert a block node?

Or I missed something in the guide?


That isn’t the case though—it can insert block nodes as well. The issue might be that it fails to find a way to fit the node at the given position. It sounds like you are parsing a whole document, which may be the problem—a document node won’t fit anywhere inside a document.


Wow! That is the issue! I have achieved it! Thank you!


@marijn I have a another question.

When I call the Editor props clipboardTextParser or transformPasted, it come up an error

Uncaught TypeError: this.nodes[] is not a function

at DOMSerializer.serializeNode

Or I should ask how to get the clipboard data?


You generally can’t access the clipboard from JavaScript, except when handling a paste event. Maybe you’re interested in the handlePaste prop?