Delete storedMarks when the node is deleted

:grinning: as the title said …

if I delete a <strong>dddd</strong> node, the HTML element has already removed. but when I continue typing, a bold text node appears again …

So I’m wondering how can I remove all the stored marks when it’s deleted ?

This sounds like a stored marks issue.

ProseMirror has a concept of “stored marks” - the marks that will be applied to the next characters types. They are not actually in your document, but they are in the editor state.

https://prosemirror.net/docs/ref/#state.Transaction.setStoredMarks

This is intentional behavior (most editors preserve this kind of mark when you delete something and immediately start typing again), but you could suppress it by overriding the binding for backspace/delete with a wrapped command that calls setStoredMarks on the transaction.

1 Like