-
Notifications
You must be signed in to change notification settings - Fork 250
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
Downlevel-revealed conditional comments incorrectly modified #190
Comments
Given it’s not valid HTML, it’s probably going to be easier just to post-process the HTML to find and replace the comments. From: rctyler [mailto:[email protected]] I have the job of building html emails that look great across multiple email clients. Microsoft Outlook usually gives me a lot of trouble, but one way to get around certain caveats with that client is through conditional comments. I particularly need these conditional comments to be in the form of <![if !mso]> and <![endif]> (see http://esd.io/blog/html-email-buttons-conditional-comments.html). I use Premailer.Net to inline my CSS styles, which uses CsQuery in turn. The problem is that those conditional comments are not valid html comments (intentionally so), and CsQuery is modifying them to and . This subtle change unfortunately breaks html emails in Outlook.com. Are there any workarounds? — [cid:[email protected]] 25 Berkeley Square Ben Jury Tel: +44 (0) 20 7268 7821 DISCLAIMER: The contents of this message and attachment(s) are intended for the addressee(s) only and are private and confidential. You should not use, copy or transmit this message if it is not intended for you. The opinions expressed in this message and/or any attachments are those of the author and not necessarily those of Amius, its subsidiaries and affiliates. Any facts stated and estimates and opinions given have been obtained from, or based upon sources believed by Amius to be reliable; however no representation or warranty, express or implied, is made nor responsibility of any kind accepted by Amius, its directors or employees either as to the accuracy or completeness of any information stated herein. Amius does not accept responsibility for changes made to this message after it was sent. For the protection of Amius and its clients and customers, and in compliance with regulatory requirements, the contents of both incoming and outgoing e-mail communications may be read by authorised persons within Amius other than the intended recipient(s). Although this e-mail and any attachments are believed to be free of any virus, or other defect which might affect any computer or system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by Amius for any loss or damage from receipt or use thereof. Amius Limited, is registered in England & Wales under registration number 3576013. Registered office: 3rd Floor, 25 Berkeley Square, London, W1J 6HN. Amius is a trading name of Amius Limited (AL). AL is authorised and regulated by the Financial Conduct Authority. Visit our website for further information: www.amius.comhttp://www.amius.comThis email has been scanned for email related threats and delivered safely by Mimecast. For more information please visit http://www.mimecast.com |
@BenJury, thanks for the response. That is currently what I'm having to do...I don't prefer the post processing, but in my case it doesn't add to much complexity to the code base so I'm fine with it. However, it would be nice if there was a way to ignore conditional comments when enforcing validity. |
I have the job of building html emails that need to look great across multiple email clients. Microsoft Outlook usually gives me a lot of trouble, but one way to get around certain caveats with that client is through conditional comments. I particularly need these downlevel-revealed comments to be in the form of
<![if !mso]>
and<![endif]>
(see http://esd.io/blog/html-email-buttons-conditional-comments.html). I use Premailer.Net to inline my CSS styles, which uses CsQuery in turn. The problem is that those conditional comments are not valid html comments (intentionally so), and CsQuery is modifying them to<!--[if !mso]-->
and<!--[endif]-->
. This subtle change unfortunately breaks html emails in Outlook.com. Are there any workarounds? The piece of code in question is here: https://github.com/jamietre/CsQuery/blob/master/source/CsQuery/Output/OutputFormatterDefault.cs#L435The text was updated successfully, but these errors were encountered: