spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quin...@apache.org
Subject svn commit: r122722 - /spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm /spamassassin/trunk/t/html_colors.t
Date Sat, 18 Dec 2004 22:50:58 GMT
Author: quinlan
Date: Sat Dec 18 14:50:56 2004
New Revision: 122722

URL: http://svn.apache.org/viewcvs?view=rev&rev=122722
Log:
Mozilla strips leading and trailing whitespace in colors, but IE does not

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
   spamassassin/trunk/t/html_colors.t

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm?view=diff&rev=122722&p1=spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm&r1=122721&p2=spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm&r2=122722
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm	Sat Dec 18 14:50:56 2004
@@ -965,9 +965,8 @@
 sub name_to_rgb {
   my $color = lc $_[0];
 
-  # strip leading and trailing whitespace, but not interior whitespace
-  $color =~ s/^\s+//;
-  $color =~ s/\s+$//;
+  # note: Mozilla strips leading and trailing whitespace at this point,
+  # but IE does not
 
   # named colors
   my $hex = $html_color{$color};
@@ -978,8 +977,6 @@
   # Flex Hex: John Graham-Cumming, http://www.jgc.org/pdf/lisa2004.pdf
   # strip optional # character
   $color =~ s/^#//;
-  # save off original 
-  my $original = $color;
   # pad right-hand-side to a multiple of three
   $color .= "0" x (3 - (length($color) % 3)) if (length($color) % 3);
   # split into triplets

Modified: spamassassin/trunk/t/html_colors.t
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/t/html_colors.t?view=diff&rev=122722&p1=spamassassin/trunk/t/html_colors.t&r1=122721&p2=spamassassin/trunk/t/html_colors.t&r2=122722
==============================================================================
--- spamassassin/trunk/t/html_colors.t	(original)
+++ spamassassin/trunk/t/html_colors.t	Sat Dec 18 14:50:56 2004
@@ -20,7 +20,7 @@
 use Mail::SpamAssassin;
 use Mail::SpamAssassin::HTML;
 
-plan tests => 21;
+plan tests => 24;
 
 sub try {
   my ($data, $want) = @_;
@@ -35,12 +35,16 @@
 
 # normal colors with various whitespace
 ok(try('black', '#000000'));
-ok(try(' white ', '#ffffff'));
-ok(try(' peachpuff', '#ffdab9'));
-ok(try('#abcdef ', '#abcdef'));
+ok(try('white', '#ffffff'));
+ok(try('peachpuff', '#ffdab9'));
+ok(try('#abcdef', '#abcdef'));
 ok(try('123456', '#123456'));
 
 # Flex Hex
+ok(try('black ', '#b0ac00'));
+ok(try(' white ', '#000000'));
+ok(try(' peachpuff', '#00c0ff'));
+ok(try('#peachpuff', '#0ec00f'));
 ok(try('#0f0', '#000f00'));
 ok(try('0f0f', '#0f0f00'));
 ok(try('#1234567890abcde1234567890abcde', '#34cd89'));
@@ -56,4 +60,3 @@
 ok(try('fxfefu', '#f0fef0'));
 ok(try('fafufb', '#faf0fb'));
 ok(try('fofcff', '#f0fcff'));
-ok(try('#peachpuff', '#0ec00f'));

Mime
View raw message