marktext / muya

📄 Future markdown editor for web browser applications development
MIT License
615 stars 54 forks source link

Code block cursor confusion problem when `backspace` #131

Closed Jocs closed 11 months ago

Jocs commented 11 months ago

Describe the bug If the backspace is preceded by a newline character, it will result in an error.

To Reproduce Steps to reproduce the behavior:

  1. Create javascript code block
  2. Input codes bellow
function add(){

}|
  1. The cursor is at the end of function add
  2. Press backspace

Expected behavior Input normally.

Actual behavior The cursor flies inside the topmost code

Operation System and Browser version (please complete the following information):

Muya Version e.g: 0.10.11