-
Notifications
You must be signed in to change notification settings - Fork 56
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
Adds support for pasting in iOS. #617
Adds support for pasting in iOS. #617
Conversation
/cc @mkevins in case you want to try this out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @diegoreymendez, it works beautifully! ✨
Tested on the example app and on WPiOS.
- Paste multiple paragraphs generates multiple blocks ✅
- Bold, Italic and (even) links are pasted properly ✅ ✨
- Headers are pasted as Header blocks ✅ ✨✨
- Even images are detected and creates an image block ✅ ✨✨✨
So, I would say that the iOS integration with the Paste feature is working properly. 🎉
One small detail I found is that pasting on the computer from notes to the simulator seems to not work. But testing on the device it works great. Even pasting from the notes app in the Mac and pasting it on the device (via Universal Clipboard) works fine. Maybe it's a simulator issue or some local problem of mine ¯\_(ツ)_/¯. Not blocker at all.
I found a couple of issues that seems to be related to the JS side of things:
1. Red screen pasting from a web page:
Pasting from random websites seems to work generally well. There are some attributes unsupported by Aztec but that's expected. The problem is that I found one particular source that, when pasting, it generated a red screen.
The source is:
https://designsbytierney.com/2010/01/how-to-add-edit-format-text-in-a-wordpress-post-or-page/
The text with issue is the text Gravity Forms
(it's a link)
2. Coping from some sources it won't paste the image.
As an example, copying text from a Wikipedia entry, it paste images properly, but when coping images from the same source mentioned before, they are omitted. I saw that the <img>
tags are passed to the JS side, so it's not an iOS issue (or it shouldn't be).
cc @mkevins
I think that these are small details, and in general pasting is working super good. Great work! 🎉
Thanks @diegoreymendez. I can't take all the credit - my work built on a lot of @iseulde's work on the web side, so credit to her and the Gutenberg team. |
@etoledom thanks for testing it out. I'm getting the same two errors you mentioned above on the Android side as well. |
Description:
This PR builds on top of @mkevins 's work to implement pasting in iOS.
This is an initial version of it, which I'm submitting for review so we can try to spot issues.
This PR also implements the unsupported HTML renderer in gutenberg, which was crashing the app when pasing HTML that Aztec doesn't know how to render.
Testing:
Copy paragraphs from another app and paste.
A good source is Safari.