MCPcopy Index your code
hub / github.com/totaljs/framework / removeComments

Function removeComments

internal.js:2524–2546  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

2522}
2523
2524function removeComments(html) {
2525 var tagBeg = '<!--';
2526 var tagEnd = '-->';
2527 var beg = html.indexOf(tagBeg);
2528 var end = 0;
2529
2530 while (beg !== -1) {
2531 end = html.indexOf(tagEnd, beg + 4);
2532
2533 if (end === -1)
2534 break;
2535
2536 var comment = html.substring(beg, end + 3);
2537 if (comment.indexOf('[if') !== -1 || comment.indexOf('[endif') !== -1) {
2538 beg = html.indexOf(tagBeg, end + 3);
2539 } else {
2540 html = html.replacer(comment, '');
2541 beg = html.indexOf(tagBeg, beg);
2542 }
2543 }
2544
2545 return html;
2546}
2547
2548function compressView(html, minify) {
2549

Callers 2

view_parseFunction · 0.85
compressHTMLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected