diff --git a/blocks/library/gallery/gallery-image.js b/blocks/library/gallery/gallery-image.js index f0bfe83251f408..fc7528aaefec48 100644 --- a/blocks/library/gallery/gallery-image.js +++ b/blocks/library/gallery/gallery-image.js @@ -2,7 +2,7 @@ export default class GalleryImage extends wp.element.Component { render() { return ( -
+
{
); diff --git a/blocks/library/gallery/index.js b/blocks/library/gallery/index.js index 0881b81fede277..a165e7b948400d 100644 --- a/blocks/library/gallery/index.js +++ b/blocks/library/gallery/index.js @@ -58,9 +58,9 @@ registerBlock( 'core/gallery', { attributes: { images: - query( 'div.blocks-gallery div.blocks-gallery-image', { - url: attr( 'data-url' ), - alt: attr( 'data-alt' ), + query( 'div.blocks-gallery div.blocks-gallery-image img', { + url: attr( 'src' ), + alt: attr( 'alt' ), } ), }, diff --git a/blocks/test/fixtures/core-gallery.html b/blocks/test/fixtures/core-gallery.html index e8d15b33c967c1..126b9a6d840d1c 100644 --- a/blocks/test/fixtures/core-gallery.html +++ b/blocks/test/fixtures/core-gallery.html @@ -1,10 +1,10 @@ diff --git a/blocks/test/fixtures/core-gallery.json b/blocks/test/fixtures/core-gallery.json index f36b3596161448..460b572d6c2516 100644 --- a/blocks/test/fixtures/core-gallery.json +++ b/blocks/test/fixtures/core-gallery.json @@ -4,8 +4,8 @@ "blockType": "core/gallery", "attributes": { "images": [ - {}, - {} + { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "title" }, + { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "title" } ] } } diff --git a/blocks/test/fixtures/core-gallery.serialized.html b/blocks/test/fixtures/core-gallery.serialized.html index a91d7eb1c663a1..7a61a9a5c2797b 100644 --- a/blocks/test/fixtures/core-gallery.serialized.html +++ b/blocks/test/fixtures/core-gallery.serialized.html @@ -1,7 +1,7 @@