Skip to content
Snippets Groups Projects
Commit 9f44e5f3 authored by Luke Leber's avatar Luke Leber Committed by Martin Anderson-Clutz
Browse files

Issue #3260643 by Luke.Leber: Duplicate markup generated for core "webp" conversion image style

parent 9056c275
No related branches found
No related tags found
1 merge request!22Issue #3260643: Duplicate markup generated for core "webp" conversion image style
......@@ -67,6 +67,11 @@ function webp_preprocess_responsive_image(&$variables) {
$webp = \Drupal::service('webp.webp');
$webp_srcset = $webp->getWebpSrcset($srcset_orig);
// Skip generation if the original is already in webp format.
if ($srcset_orig === $webp_srcset) {
continue;
}
// Create a new source pointing to the webp URL.
$webp_source = clone $source;
$webp_source->offsetSet($srcset_attribute_key, $webp_srcset);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment