# This script is meant to be a drop-in replacement of text-extract.pl
-# FIXME: Trailing spaces are not yet handled correctly
-
use Getopt::Long;
use strict;
last unless defined $s;
my($kind, $t, $attr) = @$s; # FIXME
if ($kind eq KIND_TEXT) {
+ $t =~ s/\s+$//s;
$text{$t} = 1 if $t =~ /\S/s; # FIXME... trailing whitespace
} elsif ($kind eq KIND_TAG && %$attr) {
# value [tag=input], meta
next if $a eq 'content' && $tag ne 'meta';
next if $a eq 'value' && $tag ne 'input';
my($key, $val, $val_orig, $order) = @{$attr->{$a}};
+ $val =~ s/\s+$//s;
$text{$val} = 1 if $val =~ /\S/s;
}
}
}
}
for my $t (keys %text) {
- printf "%s\n", $t unless $t =~ /^(?:\s|\ )*$/;
+ printf "%s\n", $t unless $t =~ /^(?:\s|\ )*$/s;
}
}