programmable-matter
programmable-matter copied to clipboard
editor invariant crash if you delete a hanging selection at the end of a code block
In an editor state like
<code>
<text code>... // some code
<cursor>
... // some more code
</text>
</code>
<p>
</anchor>Some text
</p>
if you delete the selection, the text of the following paragraph is moved into the code
node; but now there are two text
nodes (since the first one is marked), breaking the invariant on code
.
There are a couple different problems here:
- text inside a
code
should not have marks (strip them in normalization? but see below) - deleting a selection that hangs out of a
code
should not suck text into thecode
.
(Maybe text inside a code
should support marks / inlines? E.g. it would be nice to be able to put links in code blocks, or even live code.)