wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
673 stars 114 forks source link

Fix issue when removing media in the middle of a paragraph #1060

Closed planarvoid closed 7 months ago

planarvoid commented 7 months ago

Fix

This PR fixes a crash that's happening when a media item is removed in the middle of a paragraph. The fix is to ignore the spans that are wrapping the media, only to handle the ones starting right after the media end.

Test

  1. Run the unit tests without the fix
  2. Notice the PARAGRAPH span must start at paragraph boundary exception
  3. Run the unit tests with the fix

Review

@danilo04

Make sure strings will be translated: