ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.61k stars 336 forks source link

Paste from Google Docs sets wrong mark #1376

Closed Mr3zee closed 1 year ago

Mr3zee commented 1 year ago

Hi! While working with the editor, found the following bug:

Steps to reproduce:

Expected result: Bulleted list is passed with two rows: first row has Italic mark, second row does not Actual result: Both rows have Italic mark

marijnh commented 1 year ago

This patch should help here.

katepol commented 1 year ago

@marijnh still having issues with this, please see the screencast. There are 2 cases: 1) when copy lines (as in issue description) -> the second line gets strong mark 2) when copy all document (cmd+A) -> the second line is italic.

https://github.com/ProseMirror/prosemirror/assets/484436/2eb159ca-d4ce-4e85-bab0-d5c7feb7ab85

marijnh commented 1 year ago

I cannot reproduce either of those behaviors. For me, both when selecting text and when doing ctrl-a, the pasted content has "World" in regular, non-bold, non-italic font.

katepol commented 1 year ago

What browser do you use? My recording was for Chrome, Version 114.0.5735.133 (Official Build) (arm64), MacOS Version 13.4.1 By the way, in Safari Version 16.5.1 (18615.2.9.11.7) I get everything bold, may be related to https://github.com/ProseMirror/prosemirror/issues/459

Just in case -- here is the document for testing https://docs.google.com/document/d/1Cyb3nuMObetXvD7I-KS63e7JaCXYCFKKIOIkUNSKRJs/edit?usp=sharing

katepol commented 1 year ago

Oh, I found out that the issue reproduces only when I paste into https://prosemirror.net/examples/markdown/ But when I paste into https://prosemirror.net/examples/basic/ -- the result is fine

marijnh commented 1 year ago

Ah, right, the expanded parse rules haven't been added to prosemirror-markdown. Attached patch adds them.