Open CyrilMazur opened 3 years ago
Hi,
I'm looking at automatically converting <img> tags into <picture> tags. For example, converting this
<img>
<picture>
![foo](image.jpg)
into this
<picture> <source type="image/webp" srcset="image.webp"> <img src="image.jpg"> </picture>
I've reached this point:
protected function inlineImage($excerpt) { $image = parent::inlineImage($excerpt); $image['element']['name'] = 'picture'; return $image; }
And the result is
<picture src="image.jpg" alt="foo"></picture>
But now I'm stuck. How do I add children elements into <picture>? 🤔
Hi,
I'm looking at automatically converting
<img>
tags into<picture>
tags. For example, converting thisinto this
I've reached this point:
And the result is
But now I'm stuck. How do I add children elements into
<picture>
? 🤔