From: Juriy Zaytsev Date: Fri, 5 Feb 2010 23:01:26 +0000 (-0500) Subject: Use proper characters when checking attribute value for validity when ommitting quotes; X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=27fe66f0ce38238f2235daf5e650b7cb9e1f920e;p=html-minifier.git Use proper characters when checking attribute value for validity when ommitting quotes; Make sure lower-case doctype matches. --- diff --git a/htmlparser.js b/htmlparser.js index 63c5123..a58e9f0 100644 --- a/htmlparser.js +++ b/htmlparser.js @@ -29,7 +29,7 @@ var startTag = /^<(\w+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, endTag = /^<\/(\w+)[^>]*>/, attr = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g, - doctype = /]+>/; + doctype = /^]+>/i; // Empty Elements - HTML 4.01 var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"); @@ -73,15 +73,12 @@ chars = false; } } - else if ( html.indexOf("