diff --git a/README.md b/README.md
index 87b38119..99d201ce 100644
--- a/README.md
+++ b/README.md
@@ -64,6 +64,7 @@ How does HTMLMinifier compare to other solutions — [HTML Minifier from Will Pe
| `ignoreCustomComments` | Array of regex'es that allow to ignore certain comments, when matched | `[ ]` |
| `ignoreCustomFragments` | Array of regex'es that allow to ignore certain fragments, when matched (e.g. ``, `{{ ... }}`, etc.) | `[ /<%[\s\S]*?%>/, /<\?[\s\S]*?\?>/ ]` |
| `processScripts` | Array of strings corresponding to types of script elements to process through minifier (e.g. `text/ng-template`, `text/x-handlebars-template`, etc.) | `[ ]` |
+| `processConditionalComments` | Process contents of conditional comments through minifier | `false` |
| `maxLineLength` | Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points. |
| `customEventAttributes` | Arrays of regex'es that allow to support custom event attributes for `minifyJS` (e.g. `ng-click`) | `[ /^on[a-z]{3,}$/ ]` |
| `customAttrAssign` | Arrays of regex'es that allow to support custom attribute assign expressions (e.g. `'
'`) | `[ ]` |
diff --git a/dist/htmlminifier.js b/dist/htmlminifier.js
index 91d9ea26..85c4eae7 100644
--- a/dist/htmlminifier.js
+++ b/dist/htmlminifier.js
@@ -883,9 +883,9 @@
}
function cleanConditionalComment(comment, options) {
- return comment.replace(/^(\[if\s[^\]]+\]>)([\s\S]*?)()([\s\S]*?)(=0;f--)d[f]="(?:("+a.customAttrSurround[f][0].source+")\\s*"+b+"\\s*("+a.customAttrSurround[f][1].source+"))";d.push("(?:"+b+")"),b="(?:"+d.join("|")+")"}return new RegExp("^\\s*"+b)}function c(a){return g.concat(a.customAttrAssign||[]).map(function(a){return"(?:"+a.source+")"}).join("|")}function d(a){for(var b={},c=a.split(","),d=0;d\/=]+)/,f=/=/,g=[f],h=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],i=function(){var b;return b="function"==typeof require?require("ncname"):a.NCName,b=b?b.source.slice(1,-1):"[:A-Za-z_][:\\w\\-\\.]*","((?:"+b+"\\:)?"+b+")"}(),j=new RegExp("^<"+i),k=/^\s*(\/?)>/,l=new RegExp("^<\\/"+i+"[^>]*>"),m=/^]+>/i,n=!1;"x".replace(/x(.)?/g,function(a,b){n=""===b});var o=d("area,base,basefont,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),p=d("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,noscript,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,svg,textarea,tt,u,var"),q=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),r=d("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),s=d("script,style"),t=d("abbr,b,bdi,bdo,button,cite,code,data,dfn,em,h1,h2,h3,h4,h5,h6,i,kbd,label,legend,mark,meter,output,p,pre,progress,q,rp,rt,s,samp,small,span,strong,sub,sup,time,u,var"),u=d("a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,link,main,map,mark,math,menu,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,section,select,small,span,strong,sub,sup,svg,table,template,textarea,time,u,ul,var,video,wbr"),v=d("a,abbr,address,area,article,aside,audio,b,base,bdi,bdo,blockquote,body,br,button,canvas,caption,cite,code,col,colgroup,data,datalist,dd,del,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,head,header,hgroup,hr,html,i,iframe,img,input,ins,kbd,keygen,label,legend,li,link,main,map,mark,math,menu,menuitem,meta,meter,nav,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,ruby,s,samp,script,section,select,small,source,source,span,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,u,ul,var,video,wbr"),w={},x=a.HTMLParser=function(a,c){function d(a){var b=a.match(j);if(b){var c={tagName:b[1],attrs:[]};a=a.slice(b[0].length);for(var d,e;!(d=a.match(k))&&(e=a.match(z));)a=a.slice(e[0].length),c.attrs.push(e);if(d)return c.unarySlash=d[1],c.rest=a.slice(d[0].length),c}}function e(a){var b=a.tagName,d=a.unarySlash;if(c.html5&&g&&t[g]&&!u[b]&&v[b]&&f("",g),!c.html5)for(;g&&p[g];)f("",g);q[b]&&g===b&&f("",b);var e=o[b]||"html"===b&&"head"===g||!!d,h=a.attrs.map(function(a){var b,d,e,f,g,h,i,j=7;n&&-1===a[0].indexOf('""')&&(""===a[3]&&(a[3]=void 0),""===a[4]&&(a[4]=void 0),""===a[5]&&(a[5]=void 0));var k=1;if(c.customAttrSurround)for(var l=0,m=c.customAttrSurround.length;m>l;l++,k+=j)if(b=a[k+1],h=a[k+2],b){e=a[k+3],d=e||a[k+4]||a[k+5],i=e?'"':d?"'":"",f=a[k],g=a[k+6];break}return!b&&(b=a[k])&&(h=a[k+1],e=a[k+2],d=e||a[k+3]||a[k+4],i=e?'"':d?"'":""),void 0===d&&(d=r[b]?b:e),{name:b,value:d,customAssign:h||"=",customOpen:f||"",customClose:g||"",quote:i||""}});e||(y.push({tag:b,attrs:h}),g=b,d=""),c.start&&c.start(b,h,e,d)}function f(a,b){var d;if(b){var e=b.toLowerCase();for(d=y.length-1;d>=0&&y[d].tag.toLowerCase()!==e;d--);}else d=0;if(d>=0){for(var f=y.length-1;f>=d;f--)c.end&&c.end(y[f].tag,y[f].attrs,f>d||!a);y.length=d,g=d&&y[d-1].tag}}for(var g,h,i,x,y=[],z=b(c);a;){if(h=a,g&&s[g]){var A=g.toLowerCase(),B=w[A]||(w[A]=new RegExp("([\\s\\S]*?)"+A+"[^>]*>","i"));a=a.replace(B,function(a,b){return"script"!==A&&"style"!==A&&"noscript"!==A&&(b=b.replace(//g,"$1").replace(//g,"$1")),c.chars&&c.chars(b),""}),f(""+A+">",A)}else{var C=a.indexOf("<");if(0===C){if(/^");if(D>=0){c.comment&&c.comment(a.substring(4,D)),a=a.substring(D+3),i="";continue}}if(/^");if(E>=0){c.comment&&c.comment(a.substring(2,E+1),!0),a=a.substring(E+2),i="";continue}}var F=a.match(m);if(F){c.doctype&&c.doctype(F[0]),a=a.substring(F[0].length),i="";continue}var G=a.match(l);if(G){a=a.substring(G[0].length),G[0].replace(l,f),i="/"+G[1].toLowerCase();continue}var H=d(a);if(H){a=H.rest,e(H),i=H.tagName.toLowerCase();continue}}var I;C>=0?(I=a.substring(0,C),a=a.substring(C)):(I=a,a="");var J=d(a);J?x=J.tagName:(J=a.match(l),x=J?"/"+J[1]:""),c.chars&&c.chars(I,i,x),i=""}if(a===h)throw new Error("Parse Error: "+a)}c.partialMarkup||f()};a.HTMLtoXML=function(a){var b="";return new x(a,{start:function(a,c,d){b+="<"+a;for(var e=0;e"},end:function(a){b+=""+a+">"},chars:function(a){b+=a},comment:function(a){b+=""},ignore:function(a){b+=a}}),b},a.HTMLtoDOM=function(a,b){var c=d("html,head,body,title"),e={link:"head",base:"head"};b?b=b.ownerDocument||b.getOwnerDocument&&b.getOwnerDocument()||b:"undefined"!=typeof DOMDocument?b=new DOMDocument:"undefined"!=typeof document&&document.implementation&&document.implementation.createDocument?b=document.implementation.createDocument("","",null):"undefined"!=typeof ActiveX&&(b=new ActiveXObject("Msxml.DOMDocument"));var f=[],g=b.documentElement||b.getDocumentElement&&b.getDocumentElement();if(!g&&b.createElement&&!function(){var a=b.createElement("html"),c=b.createElement("head");c.appendChild(b.createElement("title")),a.appendChild(c),a.appendChild(b.createElement("body")),b.appendChild(a)}(),b.getElementsByTagName)for(var h in c)c[h]=b.getElementsByTagName(h)[0];var i=c.body;return new x(a,{start:function(a,d,g){if(c[a])return void(i=c[a]);var h=b.createElement(a);for(var j in d)h.setAttribute(d[j].name,d[j].value);e[a]&&"boolean"!=typeof c[e[a]]?c[e[a]].appendChild(h):i&&i.appendChild&&i.appendChild(h),g||(f.push(h),i=h)},end:function(){f.length-=1,i=f[f.length-1]},chars:function(a){i.appendChild(b.createTextNode(a))},comment:function(){},ignore:function(){}}),b}}("undefined"==typeof exports?this:exports),function(a){"use strict";function b(a){return" "===a?a:" "}function c(a){return a?a.replace(/[\t\n\r ]+/g,b):a}function d(a){var b={};return a.forEach(function(a){b[a]=1}),function(a){return 1===b[a]}}function e(a){return d(a.split(/,/))}function f(a,d,e,f,g){var h="",i="";return d.preserveLineBreaks&&(a=a.replace(/^[\t ]*[\n\r][\t\n\r ]*/,function(){return h="\n",""}).replace(/[\t\n\r ]*[\n\r][\t ]*$/,function(){return i="\n",""})),e&&(a=a.replace(/^\s+/,!h&&d.conservativeCollapse?b:"")),f&&(a=a.replace(/\s+$/,!i&&d.conservativeCollapse?b:"")),g&&(a=c(a)),h+a+i}function g(a,b,c,d){var e=b&&!V(b);e&&!d.collapseInlineTagWhitespace&&(e="/"===b.charAt(0)?!T(b.slice(1)):!U(b));var g=c&&!V(c);return g&&!d.collapseInlineTagWhitespace&&(g="/"===c.charAt(0)?!U(c.slice(1)):!T(c)),f(a,d,e,g,b&&c)}function h(a){return/^\[if\s[^\]]+\]|\[endif\]$/.test(a)}function i(a,b){if(/^!/.test(a))return!0;if(b.ignoreCustomComments)for(var c=0,d=b.ignoreCustomComments.length;d>c;c++)if(b.ignoreCustomComments[c].test(a))return!0;return!1}function j(a,b){var c=b.customEventAttributes;if(c){for(var d=c.length;d--;)if(c[d].test(a))return!0;return!1}return/^on[a-z]{3,}$/.test(a)}function k(a){return/^[^\x20\t\n\f\r"'`=<>]+$/.test(a)}function l(a,b){for(var c=a.length;c--;)if(a[c].name.toLowerCase()===b)return!0;return!1}function m(a,b,c,d){return c=c?S(c.toLowerCase()):"","script"===a&&"language"===b&&"javascript"===c||"form"===a&&"method"===b&&"get"===c||"input"===a&&"type"===b&&"text"===c||"script"===a&&"charset"===b&&!l(d,"src")||"a"===a&&"name"===b&&l(d,"id")||"area"===a&&"shape"===b&&"rect"===c}function n(a,b,c){return"script"===a&&"type"===b&&W(S(c.toLowerCase()))}function o(a,b){if("script"!==a)return!1;for(var c=0,d=b.length;d>c;c++){var e=b[c].name.toLowerCase();if("type"===e){var f=S(b[c].value.split(/;/,2)[0]).toLowerCase();return""===f||W(f)}}return!0}function p(a,b,c){return("style"===a||"link"===a)&&"type"===b&&"text/css"===S(c.toLowerCase())}function q(a,b){return X(a)||"draggable"===a&&!Y(b)}function r(a,b){return/^(?:a|area|link|base)$/.test(b)&&"href"===a||"img"===b&&/^(?:src|longdesc|usemap)$/.test(a)||"object"===b&&/^(?:classid|codebase|data|usemap)$/.test(a)||"q"===b&&"cite"===a||"blockquote"===b&&"cite"===a||("ins"===b||"del"===b)&&"cite"===a||"form"===b&&"action"===a||"input"===b&&("src"===a||"usemap"===a)||"head"===b&&"profile"===a||"script"===b&&("src"===a||"for"===a)}function s(a,b){return/^(?:a|area|object|button)$/.test(b)&&"tabindex"===a||"input"===b&&("maxlength"===a||"tabindex"===a)||"select"===b&&("size"===a||"tabindex"===a)||"textarea"===b&&/^(?:rows|cols|tabindex)$/.test(a)||"colgroup"===b&&"span"===a||"col"===b&&"span"===a||("th"===b||"td"===b)&&("rowspan"===a||"colspan"===a)}function t(a,b){if("link"!==a)return!1;for(var c=0,d=b.length;d>c;c++)if("rel"===b[c].name&&"canonical"===b[c].value)return!0}function u(a,b,d,e,f){if(d&&j(b,e)){if(d=S(d).replace(/^javascript:\s*/i,"").replace(/\s*;$/,""),e.minifyJS){var g=ua(Z+d+$,e.minifyJS);return g.slice(Z.length,-$.length)}return d}return"class"===b?c(S(d)):r(b,a)?(d=S(d),e.minifyURLs&&!t(a,f)?ta(d,e.minifyURLs):d):s(b,a)?S(d):"style"===b?(d=S(d),d&&(d=d.replace(/\s*;\s*$/,"")),e.minifyCSS?va(d,e.minifyCSS,!0):d):(v(a,f)&&"content"===b?d=d.replace(/\s+/g,"").replace(/[0-9]+\.[0-9]+/g,function(a){return(+a).toString()}):d&&e.customAttrCollapse&&e.customAttrCollapse.test(b)?d=d.replace(/\n+|\r+|\s{2,}/g,""):"script"===a&&"type"===b&&(d=S(d.replace(/\s*;\s*/g,";"))),d)}function v(a,b){if("meta"!==a)return!1;for(var c=0,d=b.length;d>c;c++)if("name"===b[c].name&&"viewport"===b[c].value)return!0}function w(a){return"*{"+a+"}"}function x(a){var b=a.match(/^\*\{([\s\S]*)\}$/m);return b&&b[1]?b[1]:a}function y(a,b){return a.replace(/^(\[if\s[^\]]+\]>)([\s\S]*?)(\s*\*\/|\/\/\s*\]\]>)\s*$/,"")}function A(a,b,c){for(var d=0,e=c.length;e>d;d++)if("type"===c[d].name.toLowerCase()&&b.processScripts.indexOf(c[d].value)>-1)return O(a,b);return a}function B(a,b){return a.replace(_[b],"").replace(aa[b],"")}function C(a,b){switch(a){case"html":case"head":return!0;case"body":return!da(b);case"colgroup":return"col"===b;case"tbody":return"tr"===b}return!1}function D(a,b){switch(b){case"colgroup":return"colgroup"===a;case"tbody":return la(a)}return!1}function E(a,b){switch(a){case"html":case"head":case"body":case"colgroup":case"caption":return!0;case"li":case"optgroup":case"tr":return b===a;case"dt":case"dd":return ea(b);case"p":return fa(b);case"rb":case"rt":case"rp":return ha(b);case"rtc":return ia(b);case"option":return ja(b);case"thead":case"tbody":return ka(b);case"tfoot":return"tbody"===b;case"td":case"th":return ma(b)}return!1}function F(a,b,c){var d=!c||/^\s*$/.test(c);return d?"input"===a&&"value"===b||sa.test(b):!1}function G(a,b){for(var c=b.length-1;c>=0;c--)if(b[c].name===a)return!0;return!1}function H(a,b){switch(a){case"textarea":return!1;case"audio":case"script":case"video":if(G("src",b))return!1;break;case"iframe":if(G("src",b)||G("srcdoc",b))return!1;break;case"object":if(G("data",b))return!1;break;case"applet":if(G("code",b))return!1}return!0}function I(a){return!/^(?:script|style|pre|textarea)$/.test(a)}function J(a){return!/^(?:pre|textarea)$/.test(a)}function K(a,b,c,d,e,f,g){var h,i,j=f.caseSensitive?a.name:a.name.toLowerCase(),l=a.value,o=a.quote;if(f.removeRedundantAttributes&&m(c,j,l,b)||f.removeScriptTypeAttributes&&n(c,j,l)||f.removeStyleLinkTypeAttributes&&p(c,j,l))return"";if(l=u(c,j,l,f,b),f.removeEmptyAttributes&&F(c,j,l))return"";if(void 0!==l&&!f.removeAttributeQuotes||!k(l)){if(!f.preventAttributesEscaping){if(void 0!==f.quoteCharacter)o="'"===f.quoteCharacter?"'":'"';else{var r=(l.match(/'/g)||[]).length,s=(l.match(/"/g)||[]).length;o=s>r?"'":'"'}l='"'===o?l.replace(/"/g,"""):l.replace(/'/g,"'")}i=o+l+o,g||f.removeTagWhitespace||(i+=" ")}else i=!g||d||/\/$/.test(l)?l+" ":l;return void 0===l||f.collapseBooleanAttributes&&q(j.toLowerCase(),l.toLowerCase())?(h=j,g||(h+=" ")):h=j+a.customAssign+i,a.customOpen+h+a.customClose}function L(a){"includeAutoGeneratedTags"in a||(a.includeAutoGeneratedTags=!0);for(var b=["canCollapseWhitespace","canTrimWhitespace"],c=0,d=b.length;d>c;c++)a[b[c]]||(a[b[c]]=function(){return!1});a.minifyURLs&&"object"!=typeof a.minifyURLs&&(a.minifyURLs={}),a.minifyJS&&("object"!=typeof a.minifyJS&&(a.minifyJS={}),a.minifyJS.fromString=!0,(a.minifyJS.output||(a.minifyJS.output={})).inline_script=!0),a.minifyCSS&&("object"!=typeof a.minifyCSS&&(a.minifyCSS={}),"undefined"==typeof a.minifyCSS.advanced&&(a.minifyCSS.advanced=!1))}function M(a){return a}function N(a){var b;do b=Math.random().toString(36).slice(2);while(~a.indexOf(b));return b}function O(a,b,d){function e(a,c){return I(a)||b.canCollapseWhitespace(a,c)}function j(a,c){return J(a)||b.canTrimWhitespace(a,c)}function k(){for(var a=t.length-1;a>0&&!/^<[^\/!]/.test(t[a]);)a--;t.length=Math.max(0,a)}function l(){for(var a=t.length-1;a>0&&!/^<\//.test(t[a]);)a--;t.length=Math.max(0,a)}function m(a){var c;t.length>1&&/^(?:0&&/\s$/.test(t[t.length-1])&&(c=t.length-1),c>0&&(t[c]=t[c].replace(/\s+$/,function(c){return g(c,"comment",a,b)}))}b=b||{};var n=[];L(b),a=b.collapseWhitespace?S(a):a;var p,q,r,s,t=[],u="",v="",w=[],x=[],F=[],G="",M="",O=b.lint,T=Date.now(),V=[],W=[];a=a.replace(/([\s\S]*?)/g,function(b,c){r||(r=N(a));var d="";return V.push(c),d});var X=(b.ignoreCustomFragments||[/<%[\s\S]*?%>/,/<\?[\s\S]*?\?>/]).map(function(a){return a.source});if(X.length){var Y=new RegExp("\\s*(?:"+X.join("|")+")+\\s*","g");a=a.replace(Y,function(b){s||(s=N(a));var c=s+W.length;return W.push(b)," "+c+" "})}new R(a,{partialMarkup:d,html5:"undefined"!=typeof b.html5?b.html5:!0,start:function(a,c,d,f){var g=a.toLowerCase();if("svg"===g){n.push(b);var h={};for(var i in b)h[i]=b[i];h.keepClosingSlash=!0,h.caseSensitive=!0,b=h}a=b.caseSensitive?a:g,v=a,p=a,U(a)||(u=""),q=!1,w=c;var o=b.removeOptionalTags;if(o){var r=ra(a);r&&C(G,a)&&k(),G="",r&&E(M,a)&&(l(),o=!D(M,a)),M=""}b.collapseWhitespace&&(x.length||m(a),j(a,c)||x.push(a),e(a,c)||F.push(a));var s="<"+a,y=f&&b.keepClosingSlash;t.push(s),O&&O.testElement(a);for(var z,A=[],B=!0,H=c.length;--H>=0;)O&&O.testAttribute(a,c[H].name.toLowerCase(),c[H].value),z=K(c[H],c,a,y,H,b,B),z&&(B=!1,A.unshift(z));A.length>0?(t.push(" "),t.push.apply(t,A)):o&&ba(a)&&(G=a),t.push(t.pop()+(y?"/":"")+">")},end:function(a,c,d){var e=a.toLowerCase();"svg"===e&&(b=n.pop()),a=b.caseSensitive?a:e,b.collapseWhitespace&&(x.length?a===x[x.length-1]&&x.pop():m("/"+a),F.length&&a===F[F.length-1]&&F.pop());var f=!1;a===v&&(v="",f=!q),b.removeOptionalTags&&(f&&na(G)&&k(),G="",!ra(a)||!M||qa(M)||"p"===M&&ga(a)||l(),M=ca(a)?a:""),b.removeEmptyElements&&f&&H(a,c)?(k(),G="",M=""):(!b.includeAutoGeneratedTags&&d||t.push(""+a+">"),p="/"+a,U(a)?f&&(u+="|"):u="")},chars:function(a,d,e){if(d=""===d?"comment":d,e=""===e?"comment":e,b.collapseWhitespace){if(!x.length){if("comment"===d){var h=""===t[t.length-1];if(h&&(d=p),t.length>1&&(h||/ $/.test(u))){var i=t.length-2;t[i]=t[i].replace(/\s+$/,function(b){return a=b+a,""})}}if(d&&U("/"===d.charAt(0)?d.slice(1):d)&&(a=f(a,b,/(?:^|\s)$/.test(u))),a=d||e?g(a,d,e,b):S(a),!a&&/\s$/.test(u)&&d&&"/"===d.charAt(0))for(var m=t.length-2,n=d.slice(1);m>=0&&j(n);m--){var r=t[m],s=r.match(/^<\/([\w:-]+)>$/);if(s)n=s[1];else if(/>$/.test(r)||(t[m]=g(r,null,e,b)))break}}F.length||(a=d&&e||"html"===e?a:c(a))}"script"!==v&&"style"!==v||(b.removeCommentsFromCDATA&&(a=B(a,v)),b.removeCDATASectionsFromCDATA&&(a=z(a)),b.processScripts&&(a=A(a,b,w))),b.minifyJS&&o(v,w)&&(a=ua(a,b.minifyJS),";"===a.charAt(a.length-1)&&(a=a.slice(0,-1))),"style"===v&&b.minifyCSS&&(a=va(a,b.minifyCSS)),b.removeOptionalTags&&a&&(("html"===G||"body"===G&&!/^\s/.test(a))&&k(),G="",(oa(M)||pa(M)&&!/^\s/.test(a))&&l(),M=""),p=/^\s*$/.test(a)?d:"comment",u+=a,a&&(q=!0),O&&O.testChars(a),t.push(a)},comment:function(a,c){var d=c?"":"-->";a=h(a)?d+y(a,b)+e:b.removeComments?i(a,b)?"":"":d+a+e,b.removeOptionalTags&&a&&(G="",M=""),t.push(a)},doctype:function(a){t.push(b.useShortDoctype?"":c(a))},customAttrAssign:b.customAttrAssign,customAttrSurround:b.customAttrSurround}),b.removeOptionalTags&&(na(G)&&k(),M&&!qa(M)&&l());var Z=P(t,b);return s&&(Z=Z.replace(new RegExp("(\\s*)"+s+"([0-9]+)(\\s*)","g"),function(a,c,d,e){var g=W[+d];return b.collapseWhitespace?(" "!==c&&(g=c+g)," "!==e&&(g+=e),f(g,{preserveLineBreaks:b.preserveLineBreaks,conservativeCollapse:!0},/^\s/.test(g),/\s$/.test(g))):g})),r&&(Z=Z.replace(new RegExp("","g"),function(a,b){return V[+b]})),Q("minified in: "+(Date.now()-T)+"ms"),Z}function P(a,b){var c,d=b.maxLineLength;if(d){for(var e,f=[],g="",h=0,i=a.length;i>h;h++)e=a[h],g.length+e.length\s*$/,style:/\s*-->\s*$/},ba=e("html,head,body,colgroup,tbody"),ca=e("html,head,body,li,dt,dd,p,rb,rt,rtc,rp,optgroup,option,colgroup,caption,thead,tbody,tfoot,tr,td,th"),da=e("meta,link,script,style,template,noscript"),ea=e("dt,dd"),fa=e("address,article,aside,blockquote,details,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,main,menu,nav,ol,p,pre,section,table,ul"),ga=e("a,audio,del,ins,map,noscript,video"),ha=e("rb,rt,rtc,rp"),ia=e("rb,rtc,rp"),ja=e("option,optgroup"),ka=e("tbody,tfoot"),la=e("thead,tbody,tfoot"),ma=e("td,th"),na=e("html,head,body"),oa=e("html,body"),pa=e("head,colgroup,caption"),qa=e("dt,thead"),ra=e("a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,menu,menuitem,meta,meter,multicol,nav,nobr,noembed,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,pre,progress,q,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,spacer,span,strike,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,xmp"),sa=new RegExp("^(?:class|id|style|title|lang|dir|on(?:focus|blur|change|click|dblclick|mouse(?:down|up|over|move|out)|key(?:press|down|up)))$"),ta=function(){var b=a.RelateUrl;return"undefined"==typeof b&&"function"==typeof require&&(b=require("relateurl")),b&&b.relate?function(a,c){try{return b.relate(a,c)}catch(d){return Q(d),a}}:M}(),ua=function(){var b=a.UglifyJS;return"undefined"==typeof b&&"function"==typeof require&&(b=require("uglify-js")),b&&b.minify?function(a,c){try{return b.minify(a,c).code}catch(d){return Q(d),a}}:M}(),va=function(){var b=a.CleanCSS;return"undefined"==typeof b&&"function"==typeof require&&(b=require("clean-css")),b?function(a,c,d){try{var e=new b(c);return d?x(e.minify(w(a)).styles):e.minify(a).styles}catch(f){return Q(f),a}}:M}();a.minify=function(a,b){return O(a,b)}}("undefined"==typeof exports?this:exports),function(a){"use strict";function b(a){return/^(?:big|small|hr|blink|marquee)$/.test(a)}function c(a){return/^(?:applet|basefont|center|dir|font|isindex|strike)$/.test(a)}function d(a){return/^on[a-z]+/.test(a)}function e(a){return"style"===a.toLowerCase()}function f(a,b){return"align"===b&&/^(?:caption|applet|iframe|img|imput|object|legend|table|hr|div|h[1-6]|p)$/.test(a)||"alink"===b&&"body"===a||"alt"===b&&"applet"===a||"archive"===b&&"applet"===a||"background"===b&&"body"===a||"bgcolor"===b&&/^(?:table|t[rdh]|body)$/.test(a)||"border"===b&&/^(?:img|object)$/.test(a)||"clear"===b&&"br"===a||"code"===b&&"applet"===a||"codebase"===b&&"applet"===a||"color"===b&&/^(?:base(?:font)?)$/.test(a)||"compact"===b&&/^(?:dir|[dou]l|menu)$/.test(a)||"face"===b&&/^base(?:font)?$/.test(a)||"height"===b&&/^(?:t[dh]|applet)$/.test(a)||"hspace"===b&&/^(?:applet|img|object)$/.test(a)||"language"===b&&"script"===a||"link"===b&&"body"===a||"name"===b&&"applet"===a||"noshade"===b&&"hr"===a||"nowrap"===b&&/^t[dh]$/.test(a)||"object"===b&&"applet"===a||"prompt"===b&&"isindex"===a||"size"===b&&/^(?:hr|font|basefont)$/.test(a)||"start"===b&&"ol"===a||"text"===b&&"body"===a||"type"===b&&/^(?:li|ol|ul)$/.test(a)||"value"===b&&"li"===a||"version"===b&&"html"===a||"vlink"===b&&"body"===a||"vspace"===b&&/^(?:applet|img|object)$/.test(a)||"width"===b&&/^(?:hr|td|th|applet|pre)$/.test(a)}function g(a,b){return"href"===a&&/^\s*javascript\s*:\s*void\s*(\s+0|\(\s*0\s*\))\s*$/i.test(b)}function h(){this.log=[],this._lastElement=null,this._isElementRepeated=!1}h.prototype.testElement=function(a){c(a)?this.log.push('Found deprecated <'+a+">
element"):b(a)?this.log.push('Found presentational <'+a+">
element"):this.checkRepeatingElement(a)},h.prototype.checkRepeatingElement=function(a){"br"===a&&"br"===this._lastElement?this._isElementRepeated=!0:this._isElementRepeated&&(this._reportRepeatingElement(),this._isElementRepeated=!1),this._lastElement=a},h.prototype._reportRepeatingElement=function(){this.log.push("Found <br>
sequence. Try replacing it with styling.")},h.prototype.testAttribute=function(a,b,c){d(b)?this.log.push('Found event attribute ('+b+") on <"+a+">
element."):f(a,b)?this.log.push('Found deprecated '+b+" attribute on <"+a+">
element."):e(b)?this.log.push('Found style attribute on <'+a+">
element."):g(b,c)&&this.log.push('Found inaccessible attribute (on <'+a+">
element).")},h.prototype.testChars=function(a){this._lastElement="",/( \s*){2,}/.test(a)&&this.log.push("Found repeating
sequence. Try replacing it with styling.")},h.prototype.test=function(a,b,c){this.testElement(a),this.testAttribute(a,b,c)},h.prototype.populate=function(a){if(this._isElementRepeated&&this._reportRepeatingElement(),this.log.length)if(a)a.innerHTML="- "+this.log.join("
- ")+"
";else{var b=" - "+this.log.join("\n - ").replace(/(<([^>]+)>)/gi,"").replace(/</g,"<").replace(/>/g,">");console.log(b)}},a.HTMLLint=h}("undefined"==typeof exports?this:exports);
\ No newline at end of file
+!function(a){"use strict";function b(a){var b=e.source+"(?:\\s*("+c(a)+")\\s*(?:"+h.join("|")+"))?";if(a.customAttrSurround){for(var d=[],f=a.customAttrSurround.length-1;f>=0;f--)d[f]="(?:("+a.customAttrSurround[f][0].source+")\\s*"+b+"\\s*("+a.customAttrSurround[f][1].source+"))";d.push("(?:"+b+")"),b="(?:"+d.join("|")+")"}return new RegExp("^\\s*"+b)}function c(a){return g.concat(a.customAttrAssign||[]).map(function(a){return"(?:"+a.source+")"}).join("|")}function d(a){for(var b={},c=a.split(","),d=0;d\/=]+)/,f=/=/,g=[f],h=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],i=function(){var b;return b="function"==typeof require?require("ncname"):a.NCName,b=b?b.source.slice(1,-1):"[:A-Za-z_][:\\w\\-\\.]*","((?:"+b+"\\:)?"+b+")"}(),j=new RegExp("^<"+i),k=/^\s*(\/?)>/,l=new RegExp("^<\\/"+i+"[^>]*>"),m=/^]+>/i,n=!1;"x".replace(/x(.)?/g,function(a,b){n=""===b});var o=d("area,base,basefont,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),p=d("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,noscript,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,svg,textarea,tt,u,var"),q=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),r=d("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),s=d("script,style"),t=d("abbr,b,bdi,bdo,button,cite,code,data,dfn,em,h1,h2,h3,h4,h5,h6,i,kbd,label,legend,mark,meter,output,p,pre,progress,q,rp,rt,s,samp,small,span,strong,sub,sup,time,u,var"),u=d("a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,link,main,map,mark,math,menu,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,section,select,small,span,strong,sub,sup,svg,table,template,textarea,time,u,ul,var,video,wbr"),v=d("a,abbr,address,area,article,aside,audio,b,base,bdi,bdo,blockquote,body,br,button,canvas,caption,cite,code,col,colgroup,data,datalist,dd,del,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,head,header,hgroup,hr,html,i,iframe,img,input,ins,kbd,keygen,label,legend,li,link,main,map,mark,math,menu,menuitem,meta,meter,nav,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,ruby,s,samp,script,section,select,small,source,source,span,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,u,ul,var,video,wbr"),w={},x=a.HTMLParser=function(a,c){function d(a){var b=a.match(j);if(b){var c={tagName:b[1],attrs:[]};a=a.slice(b[0].length);for(var d,e;!(d=a.match(k))&&(e=a.match(z));)a=a.slice(e[0].length),c.attrs.push(e);if(d)return c.unarySlash=d[1],c.rest=a.slice(d[0].length),c}}function e(a){var b=a.tagName,d=a.unarySlash;if(c.html5&&g&&t[g]&&!u[b]&&v[b]&&f("",g),!c.html5)for(;g&&p[g];)f("",g);q[b]&&g===b&&f("",b);var e=o[b]||"html"===b&&"head"===g||!!d,h=a.attrs.map(function(a){var b,d,e,f,g,h,i,j=7;n&&-1===a[0].indexOf('""')&&(""===a[3]&&(a[3]=void 0),""===a[4]&&(a[4]=void 0),""===a[5]&&(a[5]=void 0));var k=1;if(c.customAttrSurround)for(var l=0,m=c.customAttrSurround.length;m>l;l++,k+=j)if(b=a[k+1],h=a[k+2],b){e=a[k+3],d=e||a[k+4]||a[k+5],i=e?'"':d?"'":"",f=a[k],g=a[k+6];break}return!b&&(b=a[k])&&(h=a[k+1],e=a[k+2],d=e||a[k+3]||a[k+4],i=e?'"':d?"'":""),void 0===d&&(d=r[b]?b:e),{name:b,value:d,customAssign:h||"=",customOpen:f||"",customClose:g||"",quote:i||""}});e||(y.push({tag:b,attrs:h}),g=b,d=""),c.start&&c.start(b,h,e,d)}function f(a,b){var d;if(b){var e=b.toLowerCase();for(d=y.length-1;d>=0&&y[d].tag.toLowerCase()!==e;d--);}else d=0;if(d>=0){for(var f=y.length-1;f>=d;f--)c.end&&c.end(y[f].tag,y[f].attrs,f>d||!a);y.length=d,g=d&&y[d-1].tag}}for(var g,h,i,x,y=[],z=b(c);a;){if(h=a,g&&s[g]){var A=g.toLowerCase(),B=w[A]||(w[A]=new RegExp("([\\s\\S]*?)"+A+"[^>]*>","i"));a=a.replace(B,function(a,b){return"script"!==A&&"style"!==A&&"noscript"!==A&&(b=b.replace(//g,"$1").replace(//g,"$1")),c.chars&&c.chars(b),""}),f(""+A+">",A)}else{var C=a.indexOf("<");if(0===C){if(/^");if(D>=0){c.comment&&c.comment(a.substring(4,D)),a=a.substring(D+3),i="";continue}}if(/^");if(E>=0){c.comment&&c.comment(a.substring(2,E+1),!0),a=a.substring(E+2),i="";continue}}var F=a.match(m);if(F){c.doctype&&c.doctype(F[0]),a=a.substring(F[0].length),i="";continue}var G=a.match(l);if(G){a=a.substring(G[0].length),G[0].replace(l,f),i="/"+G[1].toLowerCase();continue}var H=d(a);if(H){a=H.rest,e(H),i=H.tagName.toLowerCase();continue}}var I;C>=0?(I=a.substring(0,C),a=a.substring(C)):(I=a,a="");var J=d(a);J?x=J.tagName:(J=a.match(l),x=J?"/"+J[1]:""),c.chars&&c.chars(I,i,x),i=""}if(a===h)throw new Error("Parse Error: "+a)}c.partialMarkup||f()};a.HTMLtoXML=function(a){var b="";return new x(a,{start:function(a,c,d){b+="<"+a;for(var e=0;e"},end:function(a){b+=""+a+">"},chars:function(a){b+=a},comment:function(a){b+=""},ignore:function(a){b+=a}}),b},a.HTMLtoDOM=function(a,b){var c=d("html,head,body,title"),e={link:"head",base:"head"};b?b=b.ownerDocument||b.getOwnerDocument&&b.getOwnerDocument()||b:"undefined"!=typeof DOMDocument?b=new DOMDocument:"undefined"!=typeof document&&document.implementation&&document.implementation.createDocument?b=document.implementation.createDocument("","",null):"undefined"!=typeof ActiveX&&(b=new ActiveXObject("Msxml.DOMDocument"));var f=[],g=b.documentElement||b.getDocumentElement&&b.getDocumentElement();if(!g&&b.createElement&&!function(){var a=b.createElement("html"),c=b.createElement("head");c.appendChild(b.createElement("title")),a.appendChild(c),a.appendChild(b.createElement("body")),b.appendChild(a)}(),b.getElementsByTagName)for(var h in c)c[h]=b.getElementsByTagName(h)[0];var i=c.body;return new x(a,{start:function(a,d,g){if(c[a])return void(i=c[a]);var h=b.createElement(a);for(var j in d)h.setAttribute(d[j].name,d[j].value);e[a]&&"boolean"!=typeof c[e[a]]?c[e[a]].appendChild(h):i&&i.appendChild&&i.appendChild(h),g||(f.push(h),i=h)},end:function(){f.length-=1,i=f[f.length-1]},chars:function(a){i.appendChild(b.createTextNode(a))},comment:function(){},ignore:function(){}}),b}}("undefined"==typeof exports?this:exports),function(a){"use strict";function b(a){return" "===a?a:" "}function c(a){return a?a.replace(/[\t\n\r ]+/g,b):a}function d(a){var b={};return a.forEach(function(a){b[a]=1}),function(a){return 1===b[a]}}function e(a){return d(a.split(/,/))}function f(a,d,e,f,g){var h="",i="";return d.preserveLineBreaks&&(a=a.replace(/^[\t ]*[\n\r][\t\n\r ]*/,function(){return h="\n",""}).replace(/[\t\n\r ]*[\n\r][\t ]*$/,function(){return i="\n",""})),e&&(a=a.replace(/^\s+/,!h&&d.conservativeCollapse?b:"")),f&&(a=a.replace(/\s+$/,!i&&d.conservativeCollapse?b:"")),g&&(a=c(a)),h+a+i}function g(a,b,c,d){var e=b&&!V(b);e&&!d.collapseInlineTagWhitespace&&(e="/"===b.charAt(0)?!T(b.slice(1)):!U(b));var g=c&&!V(c);return g&&!d.collapseInlineTagWhitespace&&(g="/"===c.charAt(0)?!U(c.slice(1)):!T(c)),f(a,d,e,g,b&&c)}function h(a){return/^\[if\s[^\]]+\]|\[endif\]$/.test(a)}function i(a,b){if(/^!/.test(a))return!0;if(b.ignoreCustomComments)for(var c=0,d=b.ignoreCustomComments.length;d>c;c++)if(b.ignoreCustomComments[c].test(a))return!0;return!1}function j(a,b){var c=b.customEventAttributes;if(c){for(var d=c.length;d--;)if(c[d].test(a))return!0;return!1}return/^on[a-z]{3,}$/.test(a)}function k(a){return/^[^\x20\t\n\f\r"'`=<>]+$/.test(a)}function l(a,b){for(var c=a.length;c--;)if(a[c].name.toLowerCase()===b)return!0;return!1}function m(a,b,c,d){return c=c?S(c.toLowerCase()):"","script"===a&&"language"===b&&"javascript"===c||"form"===a&&"method"===b&&"get"===c||"input"===a&&"type"===b&&"text"===c||"script"===a&&"charset"===b&&!l(d,"src")||"a"===a&&"name"===b&&l(d,"id")||"area"===a&&"shape"===b&&"rect"===c}function n(a,b,c){return"script"===a&&"type"===b&&W(S(c.toLowerCase()))}function o(a,b){if("script"!==a)return!1;for(var c=0,d=b.length;d>c;c++){var e=b[c].name.toLowerCase();if("type"===e){var f=S(b[c].value.split(/;/,2)[0]).toLowerCase();return""===f||W(f)}}return!0}function p(a,b,c){return("style"===a||"link"===a)&&"type"===b&&"text/css"===S(c.toLowerCase())}function q(a,b){return X(a)||"draggable"===a&&!Y(b)}function r(a,b){return/^(?:a|area|link|base)$/.test(b)&&"href"===a||"img"===b&&/^(?:src|longdesc|usemap)$/.test(a)||"object"===b&&/^(?:classid|codebase|data|usemap)$/.test(a)||"q"===b&&"cite"===a||"blockquote"===b&&"cite"===a||("ins"===b||"del"===b)&&"cite"===a||"form"===b&&"action"===a||"input"===b&&("src"===a||"usemap"===a)||"head"===b&&"profile"===a||"script"===b&&("src"===a||"for"===a)}function s(a,b){return/^(?:a|area|object|button)$/.test(b)&&"tabindex"===a||"input"===b&&("maxlength"===a||"tabindex"===a)||"select"===b&&("size"===a||"tabindex"===a)||"textarea"===b&&/^(?:rows|cols|tabindex)$/.test(a)||"colgroup"===b&&"span"===a||"col"===b&&"span"===a||("th"===b||"td"===b)&&("rowspan"===a||"colspan"===a)}function t(a,b){if("link"!==a)return!1;for(var c=0,d=b.length;d>c;c++)if("rel"===b[c].name&&"canonical"===b[c].value)return!0}function u(a,b,d,e,f){if(d&&j(b,e)){if(d=S(d).replace(/^javascript:\s*/i,"").replace(/\s*;$/,""),e.minifyJS){var g=ua(Z+d+$,e.minifyJS);return g.slice(Z.length,-$.length)}return d}return"class"===b?c(S(d)):r(b,a)?(d=S(d),e.minifyURLs&&!t(a,f)?ta(d,e.minifyURLs):d):s(b,a)?S(d):"style"===b?(d=S(d),d&&(d=d.replace(/\s*;\s*$/,"")),e.minifyCSS?va(d,e.minifyCSS,!0):d):(v(a,f)&&"content"===b?d=d.replace(/\s+/g,"").replace(/[0-9]+\.[0-9]+/g,function(a){return(+a).toString()}):d&&e.customAttrCollapse&&e.customAttrCollapse.test(b)?d=d.replace(/\n+|\r+|\s{2,}/g,""):"script"===a&&"type"===b&&(d=S(d.replace(/\s*;\s*/g,";"))),d)}function v(a,b){if("meta"!==a)return!1;for(var c=0,d=b.length;d>c;c++)if("name"===b[c].name&&"viewport"===b[c].value)return!0}function w(a){return"*{"+a+"}"}function x(a){var b=a.match(/^\*\{([\s\S]*)\}$/m);return b&&b[1]?b[1]:a}function y(a,b){return b.processConditionalComments?a.replace(/^(\[if\s[^\]]+\]>)([\s\S]*?)(\s*\*\/|\/\/\s*\]\]>)\s*$/,"")}function A(a,b,c){for(var d=0,e=c.length;e>d;d++)if("type"===c[d].name.toLowerCase()&&b.processScripts.indexOf(c[d].value)>-1)return O(a,b);return a}function B(a,b){return a.replace(_[b],"").replace(aa[b],"")}function C(a,b){switch(a){case"html":case"head":return!0;case"body":return!da(b);case"colgroup":return"col"===b;case"tbody":return"tr"===b}return!1}function D(a,b){switch(b){case"colgroup":return"colgroup"===a;case"tbody":return la(a)}return!1}function E(a,b){switch(a){case"html":case"head":case"body":case"colgroup":case"caption":return!0;case"li":case"optgroup":case"tr":return b===a;case"dt":case"dd":return ea(b);case"p":return fa(b);case"rb":case"rt":case"rp":return ha(b);case"rtc":return ia(b);case"option":return ja(b);case"thead":case"tbody":return ka(b);case"tfoot":return"tbody"===b;case"td":case"th":return ma(b)}return!1}function F(a,b,c){var d=!c||/^\s*$/.test(c);return d?"input"===a&&"value"===b||sa.test(b):!1}function G(a,b){for(var c=b.length-1;c>=0;c--)if(b[c].name===a)return!0;return!1}function H(a,b){switch(a){case"textarea":return!1;case"audio":case"script":case"video":if(G("src",b))return!1;break;case"iframe":if(G("src",b)||G("srcdoc",b))return!1;break;case"object":if(G("data",b))return!1;break;case"applet":if(G("code",b))return!1}return!0}function I(a){return!/^(?:script|style|pre|textarea)$/.test(a)}function J(a){return!/^(?:pre|textarea)$/.test(a)}function K(a,b,c,d,e,f,g){var h,i,j=f.caseSensitive?a.name:a.name.toLowerCase(),l=a.value,o=a.quote;if(f.removeRedundantAttributes&&m(c,j,l,b)||f.removeScriptTypeAttributes&&n(c,j,l)||f.removeStyleLinkTypeAttributes&&p(c,j,l))return"";if(l=u(c,j,l,f,b),f.removeEmptyAttributes&&F(c,j,l))return"";if(void 0!==l&&!f.removeAttributeQuotes||!k(l)){if(!f.preventAttributesEscaping){if(void 0!==f.quoteCharacter)o="'"===f.quoteCharacter?"'":'"';else{var r=(l.match(/'/g)||[]).length,s=(l.match(/"/g)||[]).length;o=s>r?"'":'"'}l='"'===o?l.replace(/"/g,"""):l.replace(/'/g,"'")}i=o+l+o,g||f.removeTagWhitespace||(i+=" ")}else i=!g||d||/\/$/.test(l)?l+" ":l;return void 0===l||f.collapseBooleanAttributes&&q(j.toLowerCase(),l.toLowerCase())?(h=j,g||(h+=" ")):h=j+a.customAssign+i,a.customOpen+h+a.customClose}function L(a){"includeAutoGeneratedTags"in a||(a.includeAutoGeneratedTags=!0);for(var b=["canCollapseWhitespace","canTrimWhitespace"],c=0,d=b.length;d>c;c++)a[b[c]]||(a[b[c]]=function(){return!1});a.minifyURLs&&"object"!=typeof a.minifyURLs&&(a.minifyURLs={}),a.minifyJS&&("object"!=typeof a.minifyJS&&(a.minifyJS={}),a.minifyJS.fromString=!0,(a.minifyJS.output||(a.minifyJS.output={})).inline_script=!0),a.minifyCSS&&("object"!=typeof a.minifyCSS&&(a.minifyCSS={}),"undefined"==typeof a.minifyCSS.advanced&&(a.minifyCSS.advanced=!1))}function M(a){return a}function N(a){var b;do b=Math.random().toString(36).slice(2);while(~a.indexOf(b));return b}function O(a,b,d){function e(a,c){return I(a)||b.canCollapseWhitespace(a,c)}function j(a,c){return J(a)||b.canTrimWhitespace(a,c)}function k(){for(var a=t.length-1;a>0&&!/^<[^\/!]/.test(t[a]);)a--;t.length=Math.max(0,a)}function l(){for(var a=t.length-1;a>0&&!/^<\//.test(t[a]);)a--;t.length=Math.max(0,a)}function m(a){var c;t.length>1&&/^(?:0&&/\s$/.test(t[t.length-1])&&(c=t.length-1),c>0&&(t[c]=t[c].replace(/\s+$/,function(c){return g(c,"comment",a,b)}))}b=b||{};var n=[];L(b),a=b.collapseWhitespace?S(a):a;var p,q,r,s,t=[],u="",v="",w=[],x=[],F=[],G="",M="",O=b.lint,T=Date.now(),V=[],W=[];a=a.replace(/([\s\S]*?)/g,function(b,c){r||(r=N(a));var d="";return V.push(c),d});var X=(b.ignoreCustomFragments||[/<%[\s\S]*?%>/,/<\?[\s\S]*?\?>/]).map(function(a){return a.source});if(X.length){var Y=new RegExp("\\s*(?:"+X.join("|")+")+\\s*","g");a=a.replace(Y,function(b){s||(s=N(a));var c=s+W.length;return W.push(b)," "+c+" "})}new R(a,{partialMarkup:d,html5:"undefined"!=typeof b.html5?b.html5:!0,start:function(a,c,d,f){var g=a.toLowerCase();if("svg"===g){n.push(b);var h={};for(var i in b)h[i]=b[i];h.keepClosingSlash=!0,h.caseSensitive=!0,b=h}a=b.caseSensitive?a:g,v=a,p=a,U(a)||(u=""),q=!1,w=c;var o=b.removeOptionalTags;if(o){var r=ra(a);r&&C(G,a)&&k(),G="",r&&E(M,a)&&(l(),o=!D(M,a)),M=""}b.collapseWhitespace&&(x.length||m(a),j(a,c)||x.push(a),e(a,c)||F.push(a));var s="<"+a,y=f&&b.keepClosingSlash;t.push(s),O&&O.testElement(a);for(var z,A=[],B=!0,H=c.length;--H>=0;)O&&O.testAttribute(a,c[H].name.toLowerCase(),c[H].value),z=K(c[H],c,a,y,H,b,B),z&&(B=!1,A.unshift(z));A.length>0?(t.push(" "),t.push.apply(t,A)):o&&ba(a)&&(G=a),t.push(t.pop()+(y?"/":"")+">")},end:function(a,c,d){var e=a.toLowerCase();"svg"===e&&(b=n.pop()),a=b.caseSensitive?a:e,b.collapseWhitespace&&(x.length?a===x[x.length-1]&&x.pop():m("/"+a),F.length&&a===F[F.length-1]&&F.pop());var f=!1;a===v&&(v="",f=!q),b.removeOptionalTags&&(f&&na(G)&&k(),G="",!ra(a)||!M||qa(M)||"p"===M&&ga(a)||l(),M=ca(a)?a:""),b.removeEmptyElements&&f&&H(a,c)?(k(),G="",M=""):(!b.includeAutoGeneratedTags&&d||t.push(""+a+">"),p="/"+a,U(a)?f&&(u+="|"):u="")},chars:function(a,d,e){if(d=""===d?"comment":d,e=""===e?"comment":e,b.collapseWhitespace){if(!x.length){if("comment"===d){var h=""===t[t.length-1];if(h&&(d=p),t.length>1&&(h||/ $/.test(u))){var i=t.length-2;t[i]=t[i].replace(/\s+$/,function(b){return a=b+a,""})}}if(d&&U("/"===d.charAt(0)?d.slice(1):d)&&(a=f(a,b,/(?:^|\s)$/.test(u))),a=d||e?g(a,d,e,b):S(a),!a&&/\s$/.test(u)&&d&&"/"===d.charAt(0))for(var m=t.length-2,n=d.slice(1);m>=0&&j(n);m--){var r=t[m],s=r.match(/^<\/([\w:-]+)>$/);if(s)n=s[1];else if(/>$/.test(r)||(t[m]=g(r,null,e,b)))break}}F.length||(a=d&&e||"html"===e?a:c(a))}"script"!==v&&"style"!==v||(b.removeCommentsFromCDATA&&(a=B(a,v)),b.removeCDATASectionsFromCDATA&&(a=z(a)),b.processScripts&&(a=A(a,b,w))),b.minifyJS&&o(v,w)&&(a=ua(a,b.minifyJS),";"===a.charAt(a.length-1)&&(a=a.slice(0,-1))),"style"===v&&b.minifyCSS&&(a=va(a,b.minifyCSS)),b.removeOptionalTags&&a&&(("html"===G||"body"===G&&!/^\s/.test(a))&&k(),G="",(oa(M)||pa(M)&&!/^\s/.test(a))&&l(),M=""),p=/^\s*$/.test(a)?d:"comment",u+=a,a&&(q=!0),O&&O.testChars(a),t.push(a)},comment:function(a,c){var d=c?"":"-->";a=h(a)?d+y(a,b)+e:b.removeComments?i(a,b)?"":"":d+a+e,b.removeOptionalTags&&a&&(G="",M=""),t.push(a)},doctype:function(a){t.push(b.useShortDoctype?"":c(a))},customAttrAssign:b.customAttrAssign,customAttrSurround:b.customAttrSurround}),b.removeOptionalTags&&(na(G)&&k(),M&&!qa(M)&&l());var Z=P(t,b);return s&&(Z=Z.replace(new RegExp("(\\s*)"+s+"([0-9]+)(\\s*)","g"),function(a,c,d,e){var g=W[+d];return b.collapseWhitespace?(" "!==c&&(g=c+g)," "!==e&&(g+=e),f(g,{preserveLineBreaks:b.preserveLineBreaks,conservativeCollapse:!0},/^\s/.test(g),/\s$/.test(g))):g})),r&&(Z=Z.replace(new RegExp("","g"),function(a,b){return V[+b]})),Q("minified in: "+(Date.now()-T)+"ms"),Z}function P(a,b){var c,d=b.maxLineLength;if(d){for(var e,f=[],g="",h=0,i=a.length;i>h;h++)e=a[h],g.length+e.length\s*$/,style:/\s*-->\s*$/},ba=e("html,head,body,colgroup,tbody"),ca=e("html,head,body,li,dt,dd,p,rb,rt,rtc,rp,optgroup,option,colgroup,caption,thead,tbody,tfoot,tr,td,th"),da=e("meta,link,script,style,template,noscript"),ea=e("dt,dd"),fa=e("address,article,aside,blockquote,details,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,main,menu,nav,ol,p,pre,section,table,ul"),ga=e("a,audio,del,ins,map,noscript,video"),ha=e("rb,rt,rtc,rp"),ia=e("rb,rtc,rp"),ja=e("option,optgroup"),ka=e("tbody,tfoot"),la=e("thead,tbody,tfoot"),ma=e("td,th"),na=e("html,head,body"),oa=e("html,body"),pa=e("head,colgroup,caption"),qa=e("dt,thead"),ra=e("a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,menu,menuitem,meta,meter,multicol,nav,nobr,noembed,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,pre,progress,q,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,spacer,span,strike,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,xmp"),sa=new RegExp("^(?:class|id|style|title|lang|dir|on(?:focus|blur|change|click|dblclick|mouse(?:down|up|over|move|out)|key(?:press|down|up)))$"),ta=function(){var b=a.RelateUrl;return"undefined"==typeof b&&"function"==typeof require&&(b=require("relateurl")),b&&b.relate?function(a,c){try{return b.relate(a,c)}catch(d){return Q(d),a}}:M}(),ua=function(){var b=a.UglifyJS;return"undefined"==typeof b&&"function"==typeof require&&(b=require("uglify-js")),b&&b.minify?function(a,c){try{return b.minify(a,c).code}catch(d){return Q(d),a}}:M}(),va=function(){var b=a.CleanCSS;return"undefined"==typeof b&&"function"==typeof require&&(b=require("clean-css")),b?function(a,c,d){try{var e=new b(c);return d?x(e.minify(w(a)).styles):e.minify(a).styles}catch(f){return Q(f),a}}:M}();a.minify=function(a,b){return O(a,b)}}("undefined"==typeof exports?this:exports),function(a){"use strict";function b(a){return/^(?:big|small|hr|blink|marquee)$/.test(a)}function c(a){return/^(?:applet|basefont|center|dir|font|isindex|strike)$/.test(a)}function d(a){return/^on[a-z]+/.test(a)}function e(a){return"style"===a.toLowerCase()}function f(a,b){return"align"===b&&/^(?:caption|applet|iframe|img|imput|object|legend|table|hr|div|h[1-6]|p)$/.test(a)||"alink"===b&&"body"===a||"alt"===b&&"applet"===a||"archive"===b&&"applet"===a||"background"===b&&"body"===a||"bgcolor"===b&&/^(?:table|t[rdh]|body)$/.test(a)||"border"===b&&/^(?:img|object)$/.test(a)||"clear"===b&&"br"===a||"code"===b&&"applet"===a||"codebase"===b&&"applet"===a||"color"===b&&/^(?:base(?:font)?)$/.test(a)||"compact"===b&&/^(?:dir|[dou]l|menu)$/.test(a)||"face"===b&&/^base(?:font)?$/.test(a)||"height"===b&&/^(?:t[dh]|applet)$/.test(a)||"hspace"===b&&/^(?:applet|img|object)$/.test(a)||"language"===b&&"script"===a||"link"===b&&"body"===a||"name"===b&&"applet"===a||"noshade"===b&&"hr"===a||"nowrap"===b&&/^t[dh]$/.test(a)||"object"===b&&"applet"===a||"prompt"===b&&"isindex"===a||"size"===b&&/^(?:hr|font|basefont)$/.test(a)||"start"===b&&"ol"===a||"text"===b&&"body"===a||"type"===b&&/^(?:li|ol|ul)$/.test(a)||"value"===b&&"li"===a||"version"===b&&"html"===a||"vlink"===b&&"body"===a||"vspace"===b&&/^(?:applet|img|object)$/.test(a)||"width"===b&&/^(?:hr|td|th|applet|pre)$/.test(a)}function g(a,b){return"href"===a&&/^\s*javascript\s*:\s*void\s*(\s+0|\(\s*0\s*\))\s*$/i.test(b)}function h(){this.log=[],this._lastElement=null,this._isElementRepeated=!1}h.prototype.testElement=function(a){c(a)?this.log.push('Found deprecated <'+a+">
element"):b(a)?this.log.push('Found presentational <'+a+">
element"):this.checkRepeatingElement(a)},h.prototype.checkRepeatingElement=function(a){"br"===a&&"br"===this._lastElement?this._isElementRepeated=!0:this._isElementRepeated&&(this._reportRepeatingElement(),this._isElementRepeated=!1),this._lastElement=a},h.prototype._reportRepeatingElement=function(){this.log.push("Found <br>
sequence. Try replacing it with styling.")},h.prototype.testAttribute=function(a,b,c){d(b)?this.log.push('Found event attribute ('+b+") on <"+a+">
element."):f(a,b)?this.log.push('Found deprecated '+b+" attribute on <"+a+">
element."):e(b)?this.log.push('Found style attribute on <'+a+">
element."):g(b,c)&&this.log.push('Found inaccessible attribute (on <'+a+">
element).")},h.prototype.testChars=function(a){this._lastElement="",/( \s*){2,}/.test(a)&&this.log.push("Found repeating
sequence. Try replacing it with styling.")},h.prototype.test=function(a,b,c){this.testElement(a),this.testAttribute(a,b,c)},h.prototype.populate=function(a){if(this._isElementRepeated&&this._reportRepeatingElement(),this.log.length)if(a)a.innerHTML="- "+this.log.join("
- ")+"
";else{var b=" - "+this.log.join("\n - ").replace(/(<([^>]+)>)/gi,"").replace(/</g,"<").replace(/>/g,">");console.log(b)}},a.HTMLLint=h}("undefined"==typeof exports?this:exports);
\ No newline at end of file
diff --git a/sample-cli-config-file.conf b/sample-cli-config-file.conf
index 40f02655..7b1a16d0 100644
--- a/sample-cli-config-file.conf
+++ b/sample-cli-config-file.conf
@@ -21,5 +21,6 @@
"minifyCSS": true,
"includeAutoGeneratedTags": false,
"ignoreCustomComments": [],
+ "processConditionalComments": true,
"processScripts": []
}
diff --git a/src/htmlminifier.js b/src/htmlminifier.js
index 2c227d67..5b7fdca5 100644
--- a/src/htmlminifier.js
+++ b/src/htmlminifier.js
@@ -349,9 +349,9 @@
}
function cleanConditionalComment(comment, options) {
- return comment.replace(/^(\[if\s[^\]]+\]>)([\s\S]*?)()([\s\S]*?)(\n' +
'