philhawksworth / netlify-plugin-minify-html

26 stars 8 forks source link

Minify HTML breaks LinkedIn post image previews #25

Open arielsalminen opened 1 year ago

arielsalminen commented 1 year ago

I spend quite a few hours recently trying to figure out why the social post previews on my website aren’t working on LinkedIn until I finally figured the culprit was this plugin. It seems like the aggressive minification that removes single/double quotation marks breaks the image previews. I understand the issue here is perhaps LinkedIn since the HTML is more or less ok, but it seems like they aren’t going to fix their system, so I’d consider fixing this in the plugin instead.

The following doesn’t work (output by this plugin):

<meta name=image property=og:image content=https://arie.ls/img/blog/team.jpg>

This works (output after disabling the plugin):

<meta name="image" property="og:image" content="https://arie.ls/img/blog/team.jpg">