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

[Bug]: removeAttributeQuotes cause WhatsApp to not load open-graph images #183

Open
nitin2953 opened this issue Sep 8, 2024 · 1 comment

Comments

@nitin2953
Copy link

What happened?

Using the removeAttributeQuotes, Open Graph (og:image) tags' attribute values without quotes prevent WhatsApp from loading preview images

Before minification (works as expected):

<meta property="og:image" content="https://example.com/image.jpg">

After minification with removeAttributeQuotes (breaks WhatsApp preview):

<meta property=og:image content=https://example.com/image.jpg>

I don't think this bug would impact many users, but a warning in the README file would be helpful to inform developers of this potential issue when using removeAttributeQuotes with Open Graph tags.

Version

v7.2.0

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

No response

Willing to submit a PR?

No

@DanielRuf
Copy link
Contributor

http://perfectionkills.com/experimenting-with-html-minifier/#remove_attribute_quotes

Please, use this optimization with care.

To me it looks like valid HTML:

image

Browsers interpret the input like this:

image

For me it seems this is a bug in WhatsApp. If this is a problem, do not use removeAttributeQuotes.

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

2 participants