Open ben-brott opened 5 years ago
This is indeed not great behavior. But on the other hand, in a document output by ProseMirror itself, mutually exclusive marks will never nest, so it's only going to show up for (somewhat strange) external input.
As such, I'd be happy with a patch that works around this, but fixing this is not a priority for me.
Steps to reproduce
Mark1
andMark2
<mark1>Mark1 content<mark2>Mark2 content</mark2>more Mark1 content</mark1>
Mark1
is not being applied tomore Mark1 content
Reproduced on glitch
Investigation
It seems that the issue is happening because in prosemirror-model,
top.activeMarks
containsMark1
, but whenMark2
is being added to the set, since the marks exclude each other,Mark1
is being removed. When it is time to apply marks tomore Mark1 content
,top.activeMarks
is empty.Removing the
exclude
from the marks definition solves the removal problem, but then, there is no way (that I have found) to ensure the ordering of the nesting is preserved. What makes the above case work would not work ifMark2
was wrapping aroundMark1
.<mark2>Mark2 content<mark1>Mark1 content</mark1>more Mark2 content</mark2>
Affected platforms
NOT browser specific.