-
Notifications
You must be signed in to change notification settings - Fork 58
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
Intercept paste without formatting command. #1360
Conversation
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.
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.
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!
@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. |
@etoledom ready for another look. |
@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. |
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.
Working perfectly now! Thanks for the update 🎉
Fixes #1311
This PR changes the code in the RNAztecView in order to override the
pasteWithoutFormatting
the same way we do withpaste
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:
RELEASE-NOTES.txt
.