Description
Hi,
We're rendering HTML emails in Go. We're using github.com/aymerick/douceur to do CSS inlining / HTML sanitization, which in turn uses golang.org/x/net/html
package under the hood.
Recently, after upgrading x/net
package, we have noticed that our HTML emails broke in certain email clients, ie. Windows / Microsoft Outlook, and rendered as a blank page.
We're using some Outlook-specific conditional comments in the HTML of our emails:
Example:
<!--[if gte mso 12]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
However, after this commit (#48237), the content of the HTML comments changed and is now being escaped:
<!--[if gte mso 12]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
Emails are hard and it's quite normal to rely on these special <!--[if mso]>
HTML comments to support Microsoft Outlook properly. See Targeting specific Outlook versions.
Questions:
- Is there any chance we could revert this change?
- Is there any chance we could provide a setting to turn off HTML comment escaping?
- Or should we consider this a breaking change "by design" and try to work around the issue (ie. by forking x/net/html)?
Thank you for your input.
Best,
Vojtech