summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/HTML/HeadParser.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/HTML/HeadParser.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/HTML/HeadParser.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/Master/tlpkg/tlperl/lib/HTML/HeadParser.pm b/Master/tlpkg/tlperl/lib/HTML/HeadParser.pm
index af3da842aed..fe6916ec494 100644
--- a/Master/tlpkg/tlperl/lib/HTML/HeadParser.pm
+++ b/Master/tlpkg/tlperl/lib/HTML/HeadParser.pm
@@ -87,7 +87,7 @@ use HTML::Entities ();
use strict;
use vars qw($VERSION $DEBUG);
#$DEBUG = 1;
-$VERSION = "3.66";
+$VERSION = "3.69";
=item $hp = HTML::HeadParser->new
@@ -207,7 +207,8 @@ sub start
$self->{'header'}->push_header($key => $attr->{content});
} elsif ($tag eq 'base') {
return unless exists $attr->{href};
- $self->{'header'}->push_header('Content-Base' => $attr->{href});
+ (my $base = $attr->{href}) =~ s/^\s+//; $base =~ s/\s+$//; # HTML5
+ $self->{'header'}->push_header('Content-Base' => $base);
} elsif ($tag eq 'isindex') {
# This is a non-standard header. Perhaps we should just ignore
# this element
@@ -218,7 +219,9 @@ sub start
} elsif ($tag eq 'link') {
return unless exists $attr->{href};
# <link href="http:..." rel="xxx" rev="xxx" title="xxx">
- my $h_val = "<" . delete($attr->{href}) . ">";
+ my $href = delete($attr->{href});
+ $href =~ s/^\s+//; $href =~ s/\s+$//; # HTML5
+ my $h_val = "<$href>";
for (sort keys %{$attr}) {
next if $_ eq "/"; # XHTML junk
$h_val .= qq(; $_="$attr->{$_}");
@@ -265,7 +268,7 @@ sub text
}
BEGIN {
- *utf8_mode = sub { 1 } unless HTML::Entities::UNICODE_SUPPORT;;
+ *utf8_mode = sub { 1 } unless HTML::Entities::UNICODE_SUPPORT;
}
1;