I’m running into the following scenario (A):
<parentElement>
<p>hello</p>
</parentElement>
<p>paragraph 2</p>
In my schema, the following is also allowed (B):
<parentElement>
<p>hello</p>
<children><p>paragraph 2</p></children>
</parentElement>
Now, when I use joinBackward in state A by hitting backspace in front of “paragraph 2”, I end up with state B. I dived into this and it’s because joinBackward has some smart logic using findWrapping
and discovers it can wrap the paragraph in a “children” element.
However, I would prefer this wrapping not to be automatically created, and merge the paragraphs instead. I.e. I would like to end up with (C):
<parentElement>
<p>helloparagraph 2</p>
</parentElement>
Is it possible to control the behavior of joinBackward for this? For example, can I set a property on “children” that would prevent it from being eligible as a wrapper?