deanhume / html-minifier

A simple command line tool to minify your HTML, Razor views & Web Forms views
http://deanhume.github.io/html-minifier/
MIT License
134 stars 86 forks source link

Problem with Knockout containerless control flow syntax #23

Closed mikilion closed 8 years ago

mikilion commented 8 years ago

The "Knockout" containerless control flow syntax should not be removed from the page.

<!-- ko if: someExpressionGoesHere -->
    <li>I want to make this item present/absent dynamically</li>
<!-- /ko -->
deanhume commented 8 years ago

@mikilion - I'm thinking about the best way to work around this as there may be other JavaScript tools that require similar style comments. I am thinking of adding an ignoreHtmlComments flag - would this work for your issue?

mikilion commented 8 years ago

@deanhume - Ignoring custom comments option by regular expression is a good idea.

deanhume commented 8 years ago

This has been fixed with the latest commit and will go out as part of Release 1.8

mikilion commented 7 years ago

The "ignoreknockoutcomments" argument doesn't work on 1.9 version. I tried to modify following regular expression: <!--(?!\[)(?!ko .*)(?!\/ko)(.*?)--> to this: <!--(?!ko .*)(?!\/ko)--> at line 164 of the class "StreamReaderExtension".

Awaiting your feed back