area's shape="rect" is a default attribute (strip it as part of "removeRedundantAttri...
authorJuriy Zaytsev <kangax@gmail.com>
Sun, 14 Mar 2010 18:23:25 +0000 (14:23 -0400)
committerJuriy Zaytsev <kangax@gmail.com>
Sun, 14 Mar 2010 18:23:25 +0000 (14:23 -0400)
src/htmlminifier.js
tests/index.html

index 2bae5d1..fd7d940 100644 (file)
         
         (tag === 'a' &&
         attrName === 'name' &&
-        attributesInclude(attrs, 'id'))
+        attributesInclude(attrs, 'id')) ||
+        
+        (tag === 'area' &&
+        attrName === 'shape' &&
+        attrValue === 'rect')
     );
   }
   
index 031cbe9..fab005b 100644 (file)
           equals(minify(input, { removeRedundantAttributes: true }), '<script>x=2,y=4<\/script>');
         });
         
+        test('removing redundant attributes (&lt;area shape="rect" ...>)', function(){
+          input = '<area shape="rect" coords="696,25,958,47" href="#" title="foo">';
+          output = '<area coords="696,25,958,47" href="#" title="foo">';
+          equals(minify(input, { removeRedundantAttributes: true }), output);
+        });
+        
         test('removing redundant attributes (&lt;... = "javascript: ..." ...>)', function(){
           input = '<p onclick="javascript:alert(1)">x</p>';
           equals(minify(input, { cleanAttributes: true }), '<p onclick="alert(1)">x</p>');