8 $x = MIME::Base64::decode_base64($x);
9 $x =~ s/>\s*</></sg; # Remove whitespace between tags.
10 $x =~ s/\s+/ /sg; # Compress whitespace.
11 $x =~ s# />#/>#g; # <foo /> -> <foo/>.
12 $x =~ s/;\s+/;/sg; # Remove whitespace in CSS.
13 $x =~ s/;"/"/g; # Remove final semicolon in CSS.
14 $x =~ s/\s+$//; # Remove tailing whitespace.
15 $x =~ s/><!DOCTYPE/>\n<!DOCTYPE/; # Add back newline after XML header.
16 $x =~ s/<svg/\n<svg/; # Add back newline after DOCTYPE.
19 print MIME::Base64::encode_base64($x, ""), "\n";