Tagged Fiddles
- 3RevisionsForks
remove non-koJS-commens from HTML
/<!--(?:(?!(\s|[\r\n])*\/?ko))(.|[\r\n])*?(?:(?!-->)*?)-->/gi<div id="ko">Foo Bar</div> <!-- ko foreach: items --> <!-- simple comment --> <div id="it"><!-- text follows here -->t: <!-- ko text: $data.text -->.<!-- /ko --><!-- end of text --></div> <!-- /ko --> <!-- ko --> <!-- unclosed comment <div class="x" /> <!-- next comment --> <!-- unclosed comment <div class="x" /> next comment without begin tag--> <!-- multiline comment Hello -->