fix(minifier): Keep attribute quotes in the SWC HTML minifier - #12369
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
I independently reproduced the issue and verified the same fix locally with quotes: true. I also added a regression test to ensure HTML attribute quotes are preserved, and verified that the test fails when quotes: true is removed. The full test suite passes locally: 184 test files / 2944 tests. So I can confirm this approach fixes the issue from my side as well. Thanks! |
|
I also verified the fix on the PR deploy preview. The generated HTML now preserves the attribute quotes: I also tested the PR deploy URL in WhatsApp, and the Open Graph image is rendered correctly in the link preview. So this confirms that |
The screenshot from @slorber here: Show the open graph image preview not working in WhatsApp. But you say it works for you? |
|
Actually I have been bitten by the caching - I had to restart my phone in between testing to flush it (possibly there's easier methods) |
|
That makes sense — thanks for confirming! I also suspected WhatsApp caching since the PR deploy was working correctly on my side. |
|
hmmm weird, now it works for me while it didn't before LGTM |


Fixes #12368
The SWC HTML minifier drops quotes from attributes, so og:image becomes property=og:image. WhatsApp then ignores the image in link previews.
Passing quotes: true keeps quoted attributes while still using the fast SWC minifier. The Terser HTML minifier path already keeps quotes.