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

Function compressCSS

internal.js:2621–2646  ·  view source on GitHub ↗
(html, index, filename, nomarkup)

Source from the content-addressed store, hash-verified

2619}
2620
2621function compressCSS(html, index, filename, nomarkup) {
2622
2623 if (!CONF.allow_compile_style)
2624 return html;
2625
2626 var strFrom = '<style type="text/css">';
2627 var strTo = '</style>';
2628
2629 var indexBeg = html.indexOf(strFrom, index || 0);
2630 if (indexBeg === -1) {
2631 strFrom = '<style>';
2632 indexBeg = html.indexOf(strFrom, index || 0);
2633 if (indexBeg === -1)
2634 return html;
2635 }
2636
2637 var indexEnd = html.indexOf(strTo, indexBeg + strFrom.length);
2638 if (indexEnd === -1)
2639 return html;
2640
2641 var css = html.substring(indexBeg, indexEnd + strTo.length);
2642 var val = css.substring(strFrom.length, css.length - strTo.length).trim();
2643 var compiled = exports.compile_css(val, filename, nomarkup);
2644 html = html.replacer(css, (strFrom + compiled.trim() + strTo).trim());
2645 return compressCSS(html, indexBeg + compiled.length + 8, filename, nomarkup);
2646}
2647
2648function variablesCSS(content) {
2649

Callers 2

internal.jsFile · 0.85
view_parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected