Unlinking distributed posts breaks image galleries
Description
We'll often use image galleries inside of our posts on our sites. When these posts are distributed, they may be unlinked on the destination site. The resulting destination post will break all galleries.
Steps to Reproduce
- Create a post on site A
- Distribute post to site B as a draft
- Head to draft on site B
- Unlink distributed post from originating site (Site A)
Expected Behavior
Image galleries remain intact
Actual Behavior
Image galleries break, treating images as individual entities in the post.
Notes
Site A's image gallery shortcode
[gallery type="rectangular" ids="412760,412761"]
Site B's image gallery (after unlinking from site A) Note that it breaks the shortcode format and reverts to standard HTML.
<div class="tiled-gallery type-rectangular tiled-gallery-unresized">
<div class="gallery-row" style="width: 1000px; height: 362px;">
<div class="gallery-group images-1" style="width: 541px; height: 362px;">
<div class="tiled-gallery-item tiled-gallery-item-large"><a href="https://9to5mac.vip.10uplabs.com/?attachment_id=412760"> <img style="width: 537px; height: 358px;" title="pad-side-table" src="http://9to5mac.vip.10uplabs.com/wp-content/uploads/sites/24/2018/04/pad-side-table.jpg?w=537&h=358&crop=1" alt="pad-side-table" width="537" height="358" /> </a></div>
</div>
<!-- close group -->
<div class="gallery-group images-1" style="width: 459px; height: 362px;">
<div class="tiled-gallery-item tiled-gallery-item-large"><a href="https://9to5mac.vip.10uplabs.com/?attachment_id=412761"> <img style="width: 455px; height: 358px;" title="pad-white-sidetable" src="http://9to5mac.vip.10uplabs.com/wp-content/uploads/sites/24/2018/04/pad-white-sidetable.jpg?w=455&h=358&crop=1" alt="pad-white-sidetable" width="455" height="358" /> </a></div>
</div>
<!-- close group -->
</div>
<!-- close row -->
</div>

Greg,
Thanks for opening this issue.
Shortcodes are typically expanded before distribution - the gallery shortcode won't work correctly on the destination site. I think the HTML you see when unlinking is expected, however it should still look the same on the front end. If you preview the post does it look right? I tried testing this locally with default WordPress themes and it seemed to work as expected.
If you preview the post does it look right?
It does not. Images look resized and overlapping text and post content. (Adding image from @adamsilverstein's internal testing.)
