AztecEditor-Android icon indicating copy to clipboard operation
AztecEditor-Android copied to clipboard

Prepending text to an image of a GB gallery block breaks GB editing

Open hypest opened this issue 7 years ago • 0 comments

Expected

Adding text in front of the first image in a GB gallery block should not break the GB editing experience (This block appears to have been modified externally. placeholder).

Observed

Adding text in front of the first image in a GB gallery block causes the This block appears to have been modified externally. placeholder to appear in GB, breaking the editing flow.

Reproduced

  1. Load the following html snippet in html mode:
<!-- wp:gallery {"columns":2} -->
<ul class="wp-block-gallery alignnone columns-2 is-cropped">
	<li>
		<figure><img src="https://cldup.com/n0g6ME5VKC.jpg" alt="" /></figure>
	</li>
	<li class="blocks-gallery-item">
		<figure><img src="https://cldup.com/ZjESfxPI3R.jpg" alt="" /></figure>
	</li>
	<li class="blocks-gallery-item">
		<figure><img src="https://cldup.com/EKNF8xD2UM.jpg" alt="" /></figure>
	</li>
</ul>
<!-- /wp:gallery -->
  1. Switch to visual mode and place the cursor at the beginning of the first image of the gallery
  2. Insert one or more characters and notice that the char(s) are placed on a line on their own
  3. Switch to html mode and notice that the character(s) have populated a new <li> element. This new shape of the gallery block is not valid for GB and causes the "modified externally" placeholder to appear.

Tested

Nexus 5X on Android v7.1.2, Aztec v1.3.6

hypest avatar Jun 19 '18 22:06 hypest