Trouble mapping Decoration.node at the start of node

As shown in this minimal demo, it’s fine if I press Enter outside of the ‘1234’ paragraph(that’s decorated with Decoration.node).

But when I place the cursor at the start of the paragraph(before ‘1’) and press Enter, unlike with Decoration.inline, the mapping don’t seem to work anymore.

Node decorations only stick to a node as long as its opening token is preserved. Because splitBlock will, if you split off all content from a non-default textblock, change its type to be a default textblock (paragraph, in this case), that will clear the node decorations on that block.

1 Like