Skip to content
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

Add support for condtional comment #146

Closed
wants to merge 2 commits into from

Conversation

zimski
Copy link

@zimski zimski commented Aug 6, 2015

Now the parser support conditional comment

  • The parser will fire openCondtionalComment when he pase some thing like .
  • The html between the two tags is parsed as usual way

@zimski zimski force-pushed the conditional_comment branch 2 times, most recently from bd63335 to f595a03 Compare August 6, 2015 16:52
Now the parser support conditional comment
+ The parser will fire openCondtionalComment when he pase some thing like
 <!--[if IE]> and an closeConditionalCommenti for  <![endif]-->.
+ The html between the two tags is parsed as usual way
@fb55
Copy link
Owner

fb55 commented Aug 6, 2015

I really don't know if I want this feature. On the one hand, it's outdated technology and won't be used on modern pages, on the other hand, I had a case where I wanted this recently and just went with a hack.

Anyway, just to get started, this should definitely be enabled by an option (HTML5 should remain the default). A link to some documentation from Microsoft to ensure all cases are covered would be nice as well.

@zimski
Copy link
Author

zimski commented Aug 7, 2015

Hi , thx for the quick reply.

I really don't know if I want this feature. On the one hand, it's outdated
technology and won't be used on modern pages, on the other hand, I had a
case where I wanted this recently and just went with a hack.

I agree with you .. the html conditional comment is a crap and are no
longer supported in IE10 (good news :) )
However, this kind of comment will still on a lot of html pages over the
web for some years, so in my mind it's a good thing that be natively
supported.

Anyway, just to get started, this should definitely be enabled by an option
(HTML5 should remain the default).

yes, i will do it

A link to some documentation from Microsoft to ensure all cases are
covered would be nice as well.

MSDN https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx

I added also this case (it's not documented in MSDN ... love Microsoft :) )

 <!--[if gt IE 8]><!-->
        <link rel="stylesheet" media="screen, projection" type="text/css" href="http://www.website.com/_ui/desktop/assets/css/common.css" />
        .....
 <!--<![endif]-->

in some cases we got:
<!--[if gt IE 8]><!-->
  <link rel="stylesheet" media="screen,... />
  ...
<!--<![endif]-->
PLease notice that the "<!-->" is parsed as a TEXT, considering the HTML5, the "<!-->"
is not a regular comment.
@fb55
Copy link
Owner

fb55 commented Jan 20, 2018

Not a feature that is part of today's web anymore, closing this.

@fb55 fb55 closed this Jan 20, 2018
@cossssmin
Copy link

MSO comments, like the one in @zimski's reply above, are still used (and necessary) in HTML emails. Would have been a very useful feature for email developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants