diff --git a/spec/Converter/ImageConverterSpec.php b/spec/Converter/ImageConverterSpec.php index c068a26..676cfae 100644 --- a/spec/Converter/ImageConverterSpec.php +++ b/spec/Converter/ImageConverterSpec.php @@ -28,6 +28,7 @@ public function it_converts_an_image_to_amp_img( $ampImg->setAttribute('srcset', '')->shouldNotBeCalled(); $ampImg->setAttribute('alt', '')->shouldNotBeCalled(); $ampImg->setAttribute('attribution', '')->shouldNotBeCalled(); + $ampImg->setAttribute('layout', '')->shouldNotBeCalled(); $element->getAttribute('src')->shouldBeCalled()->willReturn('foo.jpg'); $element->getAttribute('width')->shouldBeCalled()->willReturn(300); @@ -36,6 +37,7 @@ public function it_converts_an_image_to_amp_img( $element->getAttribute('srcset')->shouldBeCalled()->willReturn(''); $element->getAttribute('alt')->shouldBeCalled()->willReturn(''); $element->getAttribute('attribution')->shouldBeCalled()->willReturn(''); + $element->getAttribute('layout')->shouldBeCalled()->willReturn(''); $element ->createWritableElement('amp-img') diff --git a/src/Converter/ImageConverter.php b/src/Converter/ImageConverter.php index 3d9fa9f..8cdc665 100644 --- a/src/Converter/ImageConverter.php +++ b/src/Converter/ImageConverter.php @@ -8,7 +8,7 @@ class ImageConverter implements ConverterInterface { private $validAttributes = [ - 'src', 'width', 'height', 'srcset', 'alt', 'attribution', 'class' + 'src', 'width', 'height', 'srcset', 'alt', 'attribution', 'class', 'layout' ]; public function handleTagImg(EventInterface $event, ElementInterface $element)