For my prosemirror-suggestion-mode plugin I’ve now supported markup but having trouble with one interaction - deleting multi-line text. I’ve also posted this issue to github if you prefer
How to replicate:
Go to this demo
I highlight from “functionality.\nProsemirror”
and hit enter, it puts a block around the suggestion_deleted text.
From the log there you can see that the removedSlice.content.size is 2 larger than the to and from.
I get the slice with:
const removedSlice = oldState.doc.slice(step.from, step.to, false);
and it has openStart = 1 and openEnd = 1.
I get that it’s adding additional wrapping for the slice and that’s the 2 extra chars. Later I reinsert it with:
tr.insert(step.from, removedSlice.content);
What I don’t get is how I can (knowing openStart and openEnd = 1) insert the removedSlice without it having the extra wrapping. I’ve also tried
tr.replaceWith(step.from, step.from removedSlice.content)
but that doesn’t work either.
How are you to nicely insert a slice that’s openEnded?