--- modules/damieng/clean_xml/post_xml.pm 2015/04/17 15:35:01 1.1 +++ modules/damieng/clean_xml/post_xml.pm 2015/05/22 19:50:46 1.4 @@ -350,6 +350,12 @@ sub replace_m { push(@variables, $1); } } + # this regexp is for " @a = ..." + while ($text =~ /^[ \t]*\@([a-zA-Z_0-9]+)[ \t]*=/gm) { + if (!string_in_array(\@variables, $1)) { + push(@variables, $1); + } + } # this regexp is for " ($a, $b, $c) = ..." my @matches = ($text =~ /^[ \t]*\([ \t]*\$([a-zA-Z_0-9]+)(?:[ \t]*,[ \t]*\$([a-zA-Z_0-9]+))*[ \t]*\)[ \t]*=/gm); foreach my $match (@matches) { @@ -832,7 +838,7 @@ sub fix_fonts { $replacement = $doc->createElement('span'); my $css = ''; if (defined $color) { - $color =~ s/^x//; + $color =~ s/^x/#/; $properties{'color'} = $color; } if (defined $size) { @@ -2510,6 +2516,7 @@ sub trim { ## sub string_in_array { my ($array, $value) = @_; + # NOTE: would it be faster to use "any { $value eq $_ } @{$array}" from List::Util ? foreach my $v (@{$array}) { if ($v eq $value) { return 1;