You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go to WhatsApp in your phone and paste this link in the text box of any chat conversation.
You will see that product image is not displayed in WhatsApp link preview like expected.
Solution:
HTML minification has removed double-quote characters from meta tag attribute values so it looks like this: <meta property=og:image content=https://demo.nopcommerce.com/images/thumbs/0000020_build-your-own-computer_550.jpeg>
If we add double quotes to all "og:image" meta tag attributes or to "twitter:image" meta tag attributes then image preview will work: <meta property="og:image" content="https://demo.nopcommerce.com/images/thumbs/0000020_build-your-own-computer_550.jpeg">
In addition to another issue I posted about problem caused by HTML minification #6155. Maybe there should be a set of settings for how "intense" minification should be applied on HTML. for example some settings:
Keep attribute double quotes
Keep text new lines
Even with both checked page will still minify significantly due to removal of closing tags.
nopCommerce version: 4.4
Steps to reproduce the problem:
NOTE: You can jump to step 6 and use specified link from nopCommerce demo website.
You will see that product image is not displayed in WhatsApp link preview like expected.
Solution:
HTML minification has removed double-quote characters from meta tag attribute values so it looks like this:
<meta property=og:image content=https://demo.nopcommerce.com/images/thumbs/0000020_build-your-own-computer_550.jpeg>
If we add double quotes to all "og:image" meta tag attributes or to "twitter:image" meta tag attributes then image preview will work:
<meta property="og:image" content="https://demo.nopcommerce.com/images/thumbs/0000020_build-your-own-computer_550.jpeg">
In addition to another issue I posted about problem caused by HTML minification #6155. Maybe there should be a set of settings for how "intense" minification should be applied on HTML. for example some settings:
Even with both checked page will still minify significantly due to removal of closing tags.
Simplified valid/invalid HTML for WhatsApp for testing:
whatsapp-valid-image.html.txt
whatsapp-invalid-image.html.txt
The text was updated successfully, but these errors were encountered: