What is addHackNode?

Hi, I am trying to add an empty inline node to a paragraph node (which content is inline*). But once i added it via tr.insert(endPos. myEmptyInlineNode), at the end of my paragraph node, Prosemirror will add one img ProseMirror-separator and one ProseMirror-trailingBreak.

I found out this behaviour cause by these line of code

May i know what is the purpose of addHackNode and when it will be called?

Adding a <br> node at the end of blocks in editable content is a necessary kludge to make contentEditable do the right thing. These aren’t part of your actual document and you should be able to mostly just ignore the fact that they are there.

2 Likes