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