From 2b4f754e1ae5dbebc9a7c9c90666bf996336b954 Mon Sep 17 00:00:00 2001 From: Matias Ventura Date: Thu, 22 Jun 2017 13:17:03 +0200 Subject: [PATCH] ImageBlock: apply width class to figure when using captions. (#1358) --- blocks/library/image/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blocks/library/image/index.js b/blocks/library/image/index.js index 2278120ce7367..292dca03f9818 100644 --- a/blocks/library/image/index.js +++ b/blocks/library/image/index.js @@ -113,15 +113,15 @@ registerBlockType( 'core/image', { save( { attributes } ) { const { url, alt, caption, align = 'none' } = attributes; - const img = {; + // If there's no caption set only save the image element. if ( ! caption || ! caption.length ) { - return img; + return {; } return ( -
- { img } +
+ {
{ caption }
);