Skip to content

editor invariant crash if you delete a hanging selection at the end of a code block #25

@jaked

Description

@jaked

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 the code.

(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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions