Skip to content
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

Intercept paste without formatting command. #1360

Merged
merged 11 commits into from
Sep 26, 2019

Conversation

SergioEstevao
Copy link
Contributor

Fixes #1311

This PR changes the code in the RNAztecView in order to override the pasteWithoutFormatting the same way we do with paste and do the paste action in GB instead of relying in the Aztec paste.

To test: Follow the instructions on the ticket #1311.

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@SergioEstevao SergioEstevao added the [Type] Bug Something isn't working label Sep 9, 2019
@SergioEstevao SergioEstevao added this to the Open Beta milestone Sep 9, 2019
Copy link
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.

It's working good and the code looks shinny ✨

Somehow I managed to trigger a red screen by pasting without formatting.

These are the steps:

  • Copy this text from Notes App (indented list):
- hello
- Yes
    - Hi there
    - Indented
        - One more 
  • Create a new paragraph block on Gutenberg mobile.
  • Paste without formatting on that new block.

Result:
Screen Shot 2019-09-23 at 6 29 17 PM


I tried pasting other kinds of text with attributes and it was working fine.
This PR solves the original issue, and since this crash seems to be an edge case, I'm happy to ✅ and create a new ticket with this crash. But it might be worth to check it out first to be sure that's an edge case.

Let me know!

@SergioEstevao
Copy link
Contributor Author

@etoledom good find, I dig up a bit the code and found out that in your example the pasteHandler tries to see if the plainText can be markDown, and then translates it to HTML and then for some reason we get that red screen further down the line.

On you specific example the '-' are translated to a nested list elements and then make the system break.

this was not happening before, because the paste without format was handled by Aztec, and no tentative of converting from markdown was done.

@SergioEstevao
Copy link
Contributor Author

@etoledom ready for another look.

@SergioEstevao
Copy link
Contributor Author

SergioEstevao commented Sep 26, 2019

@etoledom I fixed the issue you found on this PR for GB: WordPress/gutenberg#17550.

I'm now pointing this PR to use it so that red screen should be gone.

Copy link
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.

Working perfectly now! Thanks for the update 🎉

@SergioEstevao SergioEstevao merged commit 640455e into develop Sep 26, 2019
@SergioEstevao SergioEstevao deleted the issue/1311_fix_paste_without_formatting branch September 26, 2019 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] Placeholder text remains after "Paste without Formatting"
2 participants