Outlook conditional syntax not right (?)
See original GitHub issueReproduction Steps:
- Go to https://mjml.io/try-it-live
- Click on “View HTML”
- You’ll see an error on line 8: “Unexpected character in comment found”
Expected behavior: I expect a conditional statement for Outlook to look like this:
<!--[if !mso]>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<![endif]-->
Observed behavior: They look the one below, with an extra HTML comment:
<!--[if !mso]><!-- -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
MJML version: Not sure. Whatever is being used on https://mjml.io/try-it-live
It confuses my Visual Studio Code editor and throws errors in Sendgrid. If this is supposed to be like this, can I read about it somewhere?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Outlook Conditional Code - Email2Go
Using conditional comments in HTML emails to target Outlook.
Read more >Using IF with AND, OR and NOT functions - Microsoft Support
How to use the IF function (combined with the AND, OR, and NOT functions) in Excel to make logical comparisons between given values....
Read more >HTML Email Conditional Statements
Conditional statements are comprised of “if” statements that dictate whether or not the action inside of the statement should be executed in your...
Read more >Nested IF in Excel – formula with multiple conditions - Ablebits
If the condition of the 1st If function is not met, then test the 2nd If statement, and so on. IF(check if B2>=249,...
Read more >Boolean search with multiple criteria in Outlook (AND and OR ...
Can I also perform Boolean and multi criteria searches in Outlook without ... when you know the correct search query syntax and field...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s intentional and the fix is described here https://www.emailonacid.com/blog/article/email-development/prevent-ie-edge-meta-tag-from-breaking-images-in-live-mail/
Well you can pretty much ignore the error inside the try it live because it’s not really accurate ( like the error in the try it live left part are completely related to XML, not MJML )
MJML already use an external minifier tool ( https://github.com/kangax/html-minifier ) and we don’t have any issue with our input