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

Fix Aztec Android "SetSpan" ends beyond length on merging blocks #1507

Merged

Conversation

daniloercoli
Copy link
Contributor

This PR does fix a sub-case of #872 and wordpress-mobile/WordPress-Android#9832 where the editor crashes on merging 2 blocks when the first block does have BR tag(s) at the end of its content.

GB side PR: WordPress/gutenberg#18138

To test:
Note, we should test this PR with tons of input since the changes in Aztec may break other part of the GB-Editor.

  • Create a post on Gutenberg web with a para block that ends with one or more empty line(s) (Shift+Enter)
    Screenshot 2019-10-23 at 19 55 08
  • Open this new post in GB mobile
  • Tap on the Plus symbol to add a new block below the para
  • Put the focus into this new block and taps on Backspace to merge this new block with the one above.
  • It should not crash, and the 2 blocks merged, with the caret at the end of the block

Also try many other testing scenarios.

cc @SergioEstevao

Update release notes:

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

…rg-mobile into issue/AztecAndroid-IndexOutOfBoundsException-setSpan

* 'develop' of https://github.com/wordpress-mobile/gutenberg-mobile: (50 commits)
  Update issue templates
  Update gutenberg ref
  Update gutenberg ref
  Update issue templates
  Update GB ref to point to official 1.16.0 tag
  Update RELEASE-NOTES.txt
  Update JS bundles
  Update GB ref
  Update app bundles
  Update GB reference.
  [Aztec iOS]: `shouldInteractWith` will return always true to avoid crashes
  [Aztec iOS] Cleanup white spaces.
  Update bundles.
  Update version to 1.6.0
  Updated bundles
  Force translation update when generating new bundles
  Update gutenberg ref
  720-Add support for giphy and pexel images (#1469)
  Update bundles
  Update gutenberg ref
  ...

# Conflicts:
#	gutenberg
Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

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

LGTM!

@daniloercoli daniloercoli merged commit d8685f9 into develop Nov 5, 2019
@daniloercoli daniloercoli deleted the issue/AztecAndroid-IndexOutOfBoundsException-setSpan branch November 5, 2019 17:24
@SergioEstevao
Copy link
Contributor

SergioEstevao commented Nov 5, 2019

While this PR solves some problems after this was merge I'm seeing the following issues:

  • On list, quote blocks and image captions write some text, add one single space to the end and press Enter. See the new line being inserted but the cursor staying up.
  • On the new preformatted list blocks this is even worst because inside the <pre> elements space are to be kept and this PR removes any extra space or empty lines that are inserted so when trying to insert a new line inside a pre we get a red screen.

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

Successfully merging this pull request may close these issues.

3 participants