Milkdown / milkdown

🍼 Plugin driven WYSIWYG markdown editor framework.
https://milkdown.dev
MIT License
8.97k stars 411 forks source link

[Bug] ios safari,when press enter at first line in code fence,will delete the line #200

Closed ianhwu closed 2 years ago

ianhwu commented 3 years ago

ios safari,load the https://milkdown.dev/#/getting-started

then will happend

https://user-images.githubusercontent.com/12773446/143396620-57d70976-f6c5-4379-a22a-75f08d1bd39a.MP4

Saul-Mirone commented 3 years ago

Let me have a look

Saul-Mirone commented 3 years ago

Seems it's a prosemirror bug, I'll open a issue for them.

ianhwu commented 3 years ago

thanks for reply,can you link it here?

Saul-Mirone commented 2 years ago

thanks for reply,can you link it here?

I found it's a milkdown bug, I'm working on it.

Saul-Mirone commented 2 years ago

I need some help because I still can't find the root cause, asked in community here: https://discuss.prosemirror.net/t/bug-ios-safari-when-press-enter-at-first-line-in-code-fence-will-delete-the-line/4249

philippkuehn commented 2 years ago

Interestingly, this only happens in the vue version of tiptap. the react demo works as expected 🤔

Saul-Mirone commented 2 years ago

Fixed by: https://github.com/Saul-Mirone/milkdown/commit/01d9cd3e3b738addc9182a8c8d2e9a8e8cbe926b

I finally find something, it's caused by HTML structure of the code block, if it's:

<pre>
  <code>
  Code Snippets....
  </code>
</pre>

Then it will trigger the bug. What I did is insert a div after the code tag:

<pre>
  <code>
    <div>
    Code Snippets....
    </div>
  </code>
</pre>
ianhwu commented 2 years ago

Fixed by: 01d9cd3

I finally find something, it's caused by HTML structure of the code block, if it's:

<pre>
  <code>
  Code Snippets....
  </code>
</pre>

Then it will trigger the bug. What I did is insert a div after the code tag:

<pre>
  <code>
    <div>
    Code Snippets....
    </div>
  </code>
</pre>

thanks