Add test with optgroups to "removing optional tags in <option>".
authorJuriy Zaytsev <kangax@gmail.com>
Wed, 10 Mar 2010 02:12:57 +0000 (21:12 -0500)
committerJuriy Zaytsev <kangax@gmail.com>
Wed, 10 Mar 2010 02:12:57 +0000 (21:12 -0500)
tests/index.html

index 817283e..b329e2f 100644 (file)
           input = '<select><option>foo</option><option>bar</option></select>';
           output = '<select><option>foo<option>bar</select>';
           equals(minify(input, { removeOptionalTags: true }), output);
+          
+          // example from htmldog.com
+          input = '<select name="catsndogs">' +
+                       '<optgroup label="Cats">'+
+                         '<option>Tiger</option><option>Leopard</option><option>Lynx</option>'+
+                       '</optgroup>' +
+                       '<optgroup label="Dogs">'+
+                         '<option>Grey Wolf</option><option>Red Fox</option><option>Fennec</option>'+
+                       '</optgroup>' +
+                  '</select>';
+          
+          output = '<select name="catsndogs">' +
+                       '<optgroup label="Cats">'+
+                         '<option>Tiger<option>Leopard<option>Lynx'+
+                       '</optgroup>' +
+                       '<optgroup label="Dogs">'+
+                         '<option>Grey Wolf<option>Red Fox<option>Fennec'+
+                       '</optgroup>' +
+                  '</select>';
+                  
+          equals(minify(input, { removeOptionalTags: true }), output);
         });
         
       })(this);