Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to prevent <img> to <picture> set conversion? #133

Open
MagePsycho opened this issue Sep 16, 2022 · 2 comments
Open

How to prevent <img> to <picture> set conversion? #133

MagePsycho opened this issue Sep 16, 2022 · 2 comments

Comments

@MagePsycho
Copy link

I have recently noticed one issue while using the <img/> tag in the JS variable. For example:

<script>
var imgElement = '<img src="..." />';
</script>

As Yireo_Webp2 extension converts <img/> element to <picture>...</picture> set, it throws the JS error as the output looks like

var imgElement = '<picture>
  <source type="image/webp" srcset="...">
  <source type="image/png" srcset="...">
  <img src="..." />
</picture>'

Is there a way to stop the <img/> element from the conversion

@tommypyatt
Copy link
Contributor

It's ugly, but here's a suggestion:

var imgElement = '<__TAGNAME__ src="..." />'.replace('__TAGNAME__', 'img')

@jissereitsma
Copy link
Contributor

Could you see if this issue persists after upgrading Yireo NextGenImages to version 0.3.14?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants