Skip to content

Adds support for pasting in iOS.#617

Merged
diegoreymendez merged 1 commit intodevelopfrom
issue/238-pasting-external-content-ios
Feb 19, 2019
Merged

Adds support for pasting in iOS.#617
diegoreymendez merged 1 commit intodevelopfrom
issue/238-pasting-external-content-ios

Conversation

@diegoreymendez
Copy link
Copy Markdown
Contributor

@diegoreymendez diegoreymendez commented Feb 19, 2019

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.

@diegoreymendez diegoreymendez added the [Type] Enhancement Improves a current area of the editor label Feb 19, 2019
@diegoreymendez diegoreymendez added this to the Beta milestone Feb 19, 2019
@diegoreymendez diegoreymendez self-assigned this Feb 19, 2019
@diegoreymendez
Copy link
Copy Markdown
Contributor Author

/cc @mkevins in case you want to try this out.

Copy link
Copy Markdown
Contributor

@etoledom etoledom left a 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)

img_1265

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! 🎉

@diegoreymendez
Copy link
Copy Markdown
Contributor Author

Thanks @etoledom, but again, I'd like to point out @mkevins has most of the merit here, as his work works very well almost out of the box.

I'll be opening issues for the things you spotted.

@diegoreymendez diegoreymendez merged commit 163d04f into develop Feb 19, 2019
@diegoreymendez diegoreymendez deleted the issue/238-pasting-external-content-ios branch February 19, 2019 21:38
@mkevins
Copy link
Copy Markdown
Contributor

mkevins commented Feb 20, 2019

Thanks @etoledom, but again, I'd like to point out @mkevins has most of the merit here, as his work works very well almost out of the box.

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.

@mkevins
Copy link
Copy Markdown
Contributor

mkevins commented Feb 20, 2019

@etoledom thanks for testing it out. I'm getting the same two errors you mentioned above on the Android side as well.
Screenshot with some more info:

Regarding the second error, images from that source seem to only work when only the image is copied (without any surround text).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Enhancement Improves a current area of the editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants