I'm on v0.16.0 using the example setup and encountering an oddity in Safari and Chrome (v10.0.2 and v55 respectively) running on macOS. I can reproduce this on the Basics demo page following the steps below.
- Start a code block with three backticks
- Enter some arbitrary character, say
- Delete this character with backspace
The cursor is expected to remain at the beginning of the empty code block. However, the cursor disappears for the above browsers (FF is fine). In Chrome, I get a not very helpful
The given range isn't in document error.
It appears that Chrome and Safari like to replace
<br>. So we get
<pre><br></pre> as the resulting HTML; further editing often just makes a mess. I guess ProseMirror isn't very happy about placing the cursor following an unexpected change.
A fix could be to insist all
pre elements have a
code element child when rendered, but only if it adheres to the current schema. Still new to ProseMirror here, so I'm picking it may not be so simple
I couldn't find any similar issues. Is anyone else seeing this behaviour?
This is an awesome project and I take my hat off to those involved. Thanks.