-
Notifications
You must be signed in to change notification settings - Fork 47
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
Minification mangling html with conditional comments #102
Comments
Hello, Collin! A rather complicated structure of HTML document is used here: start and end tags are placed in different conditional comments. Such code can break many HTML minifiers based on parsers (for example, this code is not correctly processed by the Juriy Zaytsev's HTML Minifier, but it causes other type of error). This error will be very difficult to fix. At the moment, I recommend two ways to solve this problem:
|
Hi Andrey. Thanks for the tip about the ignoring comment tag - I will use that as a work-around until I can find a way to simplify |
We use a large amount of conditional comments to manage outlook and IE. The workaround of ignoring comment is not scalable. I believe there's a bug somewhere if the engine is parsing tags outside of comments into comments. |
+1 to this, same problem as @jonyeezs have - anyone going to fix this? |
Hello! This error has been fixed in version 2.13.6. |
Looks like in some cases when a the opening and closing tags are in different conditional comments, this library can rewrite the html structure.
This issue was originally discovered in a far more complex html document, but I have been able to create a minimally reproducible test here:
Given this source html:
Running
Results in:
Notice the
</td></tr></table></div>
closing tags have been moved inside one of the conditionals. The source html is a valid structure with or without the conditionals, but is not a valid structure after running minifier.The text was updated successfully, but these errors were encountered: