[LON-CAPA-cvs] cvs: loncom /xml style.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sun, 09 Nov 2003 01:14:30 -0000


albertel		Sat Nov  8 20:14:30 2003 EDT

  Modified files:              
    /loncom/xml	style.pm 
  Log:
  - if the style is nothing or just ws throw it away
  
  
Index: loncom/xml/style.pm
diff -u loncom/xml/style.pm:1.19 loncom/xml/style.pm:1.20
--- loncom/xml/style.pm:1.19	Mon Sep 22 09:01:57 2003
+++ loncom/xml/style.pm	Sat Nov  8 20:14:30 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Style Parser Module (new version)
 #
-# $Id: style.pm,v 1.19 2003/09/22 13:01:57 sakharuk Exp $
+# $Id: style.pm,v 1.20 2003/11/09 01:14:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -49,7 +49,6 @@
     my ($target,$content_style_string)=@_;
     my @keys = ();
     my @values = ();
-    my @style_array = ();
     my $current_value;
     my $allow=0;
     my $pstyle = HTML::TokeParser->new(\$content_style_string);
@@ -113,10 +112,12 @@
 	    }
 	}
     }
+    my %style_for_target;
     for (my $i=0; $i<=$#keys; $i++) {
-	push @style_array,$keys[$i],$values[$i]; 
+	if ($values[$i] !~ /^\s*$/) {
+	    $style_for_target{$keys[$i]}=$values[$i]; 
+	}
     }
-    my %style_for_target =  @style_array;
     return %style_for_target; 
 }