Make sure to call elevateCaption on img_inline elements just as for img elements to prevent prevent childless block image element resulting in case of inline image with empty caption.
(Process here is hairy. ensureNonEmpty is called earlier, but the existence of a caption child -- even though an empty one -- at that stage prevents this call to ensureNotEmpty from doing anything. elevateCaption fixes this up later for images. But this was not being called on img_inline elements).
Make sure to call elevateCaption on img_inline elements just as for img elements to prevent prevent childless block image element resulting in case of inline image with empty caption.
(Process here is hairy. ensureNonEmpty is called earlier, but the existence of a caption child -- even though an empty one -- at that stage prevents this call to ensureNotEmpty from doing anything. elevateCaption fixes this up later for images. But this was not being called on img_inline elements).