-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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] Native Bridge: Fix insert blocks not handling raw string properly in unsupported block editor #47472
[Mobile] Native Bridge: Fix insert blocks not handling raw string properly in unsupported block editor #47472
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @renatoagds! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
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.
Thank @renatoagds for fixing this issue 🙇 !
I tested this change in physical devices and the simulator/emulator and I'm still experiencing the issue:
- iPhone 11 (iOS 15.4.1) ❌
- Samsung Galaxy S20 FE 5G (Android 13) ❌
- iPhone 14 - Simulator ✅ (Not sure why only in the iOS simulator works 🤔 )
- Pixel 3 API 28 emulator ❌
I'll keep investigating in case I can provide further information that helps us to address it. In the meantime, @renatoagds did you test this on a physical device? Thanks!
Following my previous comment, I noticed that I'm experiencing a different error. In my case, it's not an invalid markup format but the block missing. Error extracted from Before video capture: @renatoagds what type of site you used for test the changes? |
@fluiddot I tested in an Atomic site with |
@fluiddot I sent an invitation for you to test blog I'm using ( |
Ah, ok, thanks @renatoagds 🙇. I was testing the block now on different sites and noticed the difference. I'll re-test the PR as soon as possible 👍 . |
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.
Now using the Atomic site you provided @renatoagds I managed to confirm the fix works as expected, thanks! The PR LGTM 🎊 !
Tested on Samsung Galaxy S20 FE 5G and iPhone 11 (iOS 15.4.1).
…perly in unsupported block editor (#47472)
* Release script: Update react-native-editor version to 1.87.0 * Release script: Update with changes from 'npm run core preios' * Mobile - Update changelog * Release script: Update react-native-editor version to 1.87.1 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Remove unnecessary negative margin around empty gallery block (#47086) This PR removes some unwanted negative margin space from empty gallery blocks on native. * [Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080) * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - RichText - Parse CSS values from line height values and avoid undefined or NaN values being sent to the native TextInput * Mobile - Update Changelog * Release script: Update react-native-editor version to 1.87.2 * Release script: Update with changes from 'npm run core preios' * Add boolean contentStyle and clientId check to Column Edit InnerBlocks * Mobile - Column block - Move parentWidth to a const variable * docs: Update changelog * [Mobile] - Line-height and font-size regression fixes (#47284) * Revert "[Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080)" This reverts commit 2d44f06. * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - Avoid passing NaN line height values to Aztec. It also disables passing font size and line height values on Android for pre elements. * Mobile - Preformatted - Update snapshot to remove the fontSize value as it will be set by Aztec for Android * Update react-native-editor changelog * Release script: Update react-native-editor version to 1.87.3 * Release script: Update with changes from 'npm run core preios' * [Mobile] Native Bridge: Fix insert blocks not handling raw string properly in unsupported block editor (#47472) * Update react-native-editor changelog --------- Co-authored-by: Gerardo <gerardo.pacheco@automattic.com> Co-authored-by: Siobhan Bamber <siobhan@automattic.com> Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com> Co-authored-by: Derek Blank <derekpblank@gmail.com> Co-authored-by: Renato Augusto Gama dos Santos <renato_0603@hotmail.com>
What?
Fixing
insertBlocks
at thereact-native-bridge
call not dealing with strings that contain complex chars (like unicode).Why?
Attributes could contain HTML code, which is serialized with special chars.
Example:
In the current way, it parses the
\u
and other chars, which breaks the block.How?
Inserting
String.raw
oninsertBlocks
call.Testing Instructions
gutenberg-mobile
running locally.?
and try to edit it on the web editor.Screenshots or screencast
CleanShot.2023-01-26.at.18.49.38.mp4
CleanShot.2023-01-26.at.18.40.55.mp4