Subject: | [PATCH] follow_link expects trimmed undecoded text |
follow_link expects trimmed text, and all HTML entities should be turned into text. The attached patch fixes this problem.
Regards,
Slaven
--- Logger.pm.orig 2004-11-04 17:52:52.000000000 +0100
+++ Logger.pm 2004-11-04 17:58:41.000000000 +0100
@@ -3,6 +3,7 @@
use strict;
use warnings;
use LWP::MemberMixin;
+use HTML::Entities qw(decode_entities);
our @ISA = qw( LWP::MemberMixin );
sub new {
@@ -102,6 +103,9 @@
if ($args{text}) {
$args{text} =~ s/"/\\"/g;
+ # follow_link expects trimmed undecoded text, see HTTP::TokeParser::get_trimmed_text
+ $args{text} =~ s/^\s+//; $args{text} =~ s/\s+$//; $args{text} =~ s/\s+/ /g;
+ $args{text} = decode_entities $args{text};
$self->Log("follow_link",
"text => \"$args{text}\", n => \"$args{index}\"");
} else {