-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty paragraphs are pasted in with an extra <br> when copied from Google Docs #1511
Comments
The HTML we get in this case looks, if I remove the attributes, like this:
ProseMirror assumes the stray |
Hmm. Google at it again... This is going to come up a lot for the community using my application, lots of authors copy paste from GDocs. But maybe if that's not common usage for Prosemirror overall it should be fixed on my end? That would be Edit: I went ahead and just fixed it on my end. Feel free to do what you like with this issue. |
I'm going to leave this open and see if more people are running into it. It's quite possible that this is a recent change in Google Docs—I'm pretty sure that last time I looked, empty paragraphs had a |
I don't think it is recent but I am not positive. Would appreciate a special case here as I sporadically paste a lot from Google docs. |
Right now, we're using a somewhat messy It would be great if ProseMirror natively preserved the formatting of content pasted from Google Docs and other Word-like editors. |
I'm not sure how you expect that to work. Firstly, ProseMirror is schema-agnostic, so it doesn't magically know how the nodes you define would map to whatever equivalent constructs exist in the various word processing systems. Secondly, as you found, these spit out all kinds of completely ludicrous HTML, and in some situations it's not even clear how to extract the semantic meaning from that. |
I don't actually know if this is Google Docs's copy format in specific or if this would always occur for empty paragraphs like this.
To reproduce:
The text was updated successfully, but these errors were encountered: