wordpress-mobile / AztecEditor-Android

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

Enable media within paragraph blocks #984

Closed planarvoid closed 1 year ago

planarvoid commented 1 year ago

Previously we've added the option to addMediaAfterBlocks. This works well with almost all the blocks but it doesn't work nicely with paragraphs. We want to be able to add images within paragraphs and not only after the currently selected paragraph. This is important for paragraphs with linebreaks (where the image should be logically positioned at the linebreak, not after the paragraph).

You can test this by setting EXAMPLE to

<p>test<br>
<br>
test</p>

Test

  1. Turn on addMediaAfterBlocks on the visual editor
  2. Run the app with the EXAMPLE set from the code above
  3. Click between the lines
  4. Add an image
  5. Notice it gets added between the lines, not at the end of the document

Review

@danilo04

Make sure strings will be translated: