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

[Mobile] - Fix issues when pasting HTML content #62588

Merged
merged 2 commits into from
Jun 17, 2024
Merged

Conversation

geriux
Copy link
Member

@geriux geriux commented Jun 14, 2024

Related PRs:

What?

Fixes wordpress-mobile/gutenberg-mobile#1157 where copying HTML from other external apps would fail to retain the formatting.

Why?

To prevent removing list formatting from external apps like the iOS Notes app when pasting content into the editor.

How?

By removing the prefix check and allow the pasteHandler functionality to handle the full HTML content.

The original issue also mentions Android but the issues it mentions was when we didn't have the List block with inner blocks and we were using Aztec's List formatter.

Testing Instructions

Note

Please use the following builds to test:

Case 1 - Pasting content from the iOS Notes app

  • Open the editor
  • Paste list items from the Notes app
  • Expect to see the lists as List blocks, not Paragraph blocks.

Case 2 - Pasting content from a Website

  • Open the editor
  • Go to a Website and copy some of the content
  • Paste it into the editor
  • Expect the content to be inserted with its format

Testing Instructions for Keyboard

N/A

Screenshots or screencast

iOSPaste.mov

@geriux geriux added [Type] Bug An existing feature does not function as intended Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) labels Jun 14, 2024
@geriux geriux changed the title [Mobile] - readHTML - remove DOCTYPE check [Mobile] - Fix issues when pasting HTML content Jun 14, 2024
@geriux geriux requested a review from twstokes June 14, 2024 16:11
@geriux geriux marked this pull request as ready for review June 14, 2024 16:12
Copy link

github-actions bot commented Jun 14, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @SergioEstevao, @etoledom.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: SergioEstevao, etoledom.

Co-authored-by: geriux <geriux@git.wordpress.org>
Co-authored-by: twstokes <twstokes@git.wordpress.org>
Co-authored-by: hypest <hypest@git.wordpress.org>
Co-authored-by: mchowning <mattchowning@git.wordpress.org>
Co-authored-by: rachelmcr <rachelmcr@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@twstokes twstokes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked great for me @geriux. Thanks! 🚀

@geriux geriux merged commit 6633dc3 into trunk Jun 17, 2024
65 checks passed
@geriux geriux deleted the fix/ios-paste-content branch June 17, 2024 14:03
@github-actions github-actions bot added this to the Gutenberg 18.7 milestone Jun 17, 2024
huubl pushed a commit to huubl/gutenberg that referenced this pull request Jun 17, 2024
* iOS - readHTML remove DOCTYPE check since pasteHandler handles it

* Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List block: Pasting lists with indented items loses the bullets
2 participants