grunt-usemin icon indicating copy to clipboard operation
grunt-usemin copied to clipboard

Some IE Conditionals are now broken

Open schmod opened this issue 10 years ago • 3 comments

With the merge of #539, IE conditionals are no longer being parsed correctly.

In particular, conditionals that are visible to other browsers are not fully recognized or replaced (leaving fragments of the original conditional on the page).

For example, this block would not be processed correctly:

<!-- build:js javascripts/vendor/selectivizr.js -->
  <!--[if (lt IE 9) & (!IEmobile)]><!-->
    <script src="javascripts/vendor/selectivizr/selectivizr.js"></script>
  <!--<![endif]-->
<!-- endbuild -->

schmod avatar Jun 09 '15 18:06 schmod

Mind trying this with the dev branch and letting us know if it is fixed? Thanks.

I think the right order would anyways be

<!--[if (lt IE 9) & (!IEmobile)]><!-->
  <!-- build:js javascripts/vendor/selectivizr.js -->
    <script src="javascripts/vendor/selectivizr/selectivizr.js"></script>
  <!-- endbuild -->
<!--<![endif]-->

Instead of what you did.

arthurvr avatar Jun 10 '15 05:06 arthurvr

So, the example you gave does work, but I wouldn't encourage using it because the "IE-only" version of your snippet would be invalid HTML, which is something that we probably don't want to encourage:

<!--[if (lt IE 9) & (!IEmobile)]>
  <!-- build:js javascripts/vendor/selectivizr.js -->
    <script src="javascripts/vendor/selectivizr/selectivizr.js"></script>
  <!-- endbuild -->
<![endif]-->

schmod avatar Jun 10 '15 16:06 schmod

Also, I should have been more specific: This issue only affects the dev branch -- it's an unreleased regression.

schmod avatar Jun 10 '15 16:06 schmod