summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/HTML/HeadParser.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-21 00:15:27 +0000
committerKarl Berry <karl@freefriends.org>2012-05-21 00:15:27 +0000
commita4c42bfb2337d37da89d789cb8cc226367994e32 (patch)
treec3eabdef5d565a4e515d2be0d9d4d0540bde0250 /Master/tlpkg/tlperl/lib/HTML/HeadParser.pm
parent8274475057f024d35332ac47c2e2f23ea156e6ed (diff)
perl 5.14.2 from siep
git-svn-id: svn://tug.org/texlive/trunk@26525 c570f23f-e606-0410-a88d-b1316a301751
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;