Skip to content

Commit

Permalink
Fix sources in webp source tags of image extension (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manours committed Oct 20, 2022
1 parent bda5ea3 commit 4ed8fda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ImageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ private function createImage(
if ($srcset) {
$sources[] = [
'srcset' => $srcset,
'sizes' => $attributes['sizes'] ?? null,
'type' => $type,
];
}
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ImageExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public function testComplexWebpPictureTag(): void
$this->assertSame(
'<picture>' .
'<source srcset="/uploads/media/sulu-100x100/01/image.webp?v=1-0 460w, /uploads/media/sulu-170x170/01/image.webp?v=1-0 800w, /uploads/media/sulu-400x400/01/image.webp?v=1-0 1024w"' .
' sizes="(max-width: 1024px) 100vw, (max-width: 800px) 100vw, 100vw"' .
' type="image/webp">' .
'<img alt="Logo"' .
' title="Description"' .
Expand Down

0 comments on commit 4ed8fda

Please sign in to comment.