r60181 - in /branches/upstream/libhtml-parser-perl/current: Changes META.yml Parser.pm lib/HTML/HeadParser.pm t/headparser.t
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Sat Jul 10 06:55:05 UTC 2010
Author: carnil-guest
Date: Sat Jul 10 06:51:29 2010
New Revision: 60181
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60181
Log:
[svn-upgrade] new version libhtml-parser-perl (3.66)
Modified:
branches/upstream/libhtml-parser-perl/current/Changes
branches/upstream/libhtml-parser-perl/current/META.yml
branches/upstream/libhtml-parser-perl/current/Parser.pm
branches/upstream/libhtml-parser-perl/current/lib/HTML/HeadParser.pm
branches/upstream/libhtml-parser-perl/current/t/headparser.t
Modified: branches/upstream/libhtml-parser-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/Changes?rev=60181&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/Changes (original)
+++ branches/upstream/libhtml-parser-perl/current/Changes Sat Jul 10 06:51:29 2010
@@ -1,3 +1,10 @@
+_______________________________________________________________________________
+2010-07-09 Release 3.66
+
+Gisle Aas (1):
+ Fix entity decoding in utf8_mode for the title header
+
+
_______________________________________________________________________________
2010-04-04 Release 3.65
Modified: branches/upstream/libhtml-parser-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/META.yml?rev=60181&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/META.yml (original)
+++ branches/upstream/libhtml-parser-perl/current/META.yml Sat Jul 10 06:51:29 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: HTML-Parser
-version: 3.65
+version: 3.66
abstract: HTML parser class
author:
- Gisle Aas <gisle at activestate.com>
Modified: branches/upstream/libhtml-parser-perl/current/Parser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/Parser.pm?rev=60181&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/Parser.pm (original)
+++ branches/upstream/libhtml-parser-perl/current/Parser.pm Sat Jul 10 06:51:29 2010
@@ -9,7 +9,7 @@
use strict;
use vars qw($VERSION @ISA);
-$VERSION = "3.65";
+$VERSION = "3.66";
require HTML::Entities;
Modified: branches/upstream/libhtml-parser-perl/current/lib/HTML/HeadParser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/lib/HTML/HeadParser.pm?rev=60181&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/lib/HTML/HeadParser.pm (original)
+++ branches/upstream/libhtml-parser-perl/current/lib/HTML/HeadParser.pm Sat Jul 10 06:51:29 2010
@@ -87,7 +87,7 @@
use strict;
use vars qw($VERSION $DEBUG);
#$DEBUG = 1;
-$VERSION = "3.62";
+$VERSION = "3.66";
=item $hp = HTML::HeadParser->new
@@ -157,7 +157,10 @@
$text =~ s/\s+/ /g;
print "FLUSH $tag => '$text'\n" if $DEBUG;
if ($tag eq 'title') {
+ my $decoded;
+ $decoded = utf8::decode($text) if $self->utf8_mode && defined &utf8::decode;
HTML::Entities::decode($text);
+ utf8::encode($text) if $decoded;
$self->{'header'}->push_header(Title => $text);
}
$self->{'tag'} = $self->{'text'} = '';
Modified: branches/upstream/libhtml-parser-perl/current/t/headparser.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/t/headparser.t?rev=60181&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/t/headparser.t (original)
+++ branches/upstream/libhtml-parser-perl/current/t/headparser.t Sat Jul 10 06:51:29 2010
@@ -1,7 +1,7 @@
#!perl -w
use strict;
-use Test::More tests => 15;
+use Test::More tests => 16;
{ package H;
sub new { bless {}, shift; }
@@ -147,7 +147,7 @@
ok(!$p->as_string);
SKIP: {
- skip "Need Unicode support", 4 if $] < 5.008;
+ skip "Need Unicode support", 5 if $] < 5.008;
# Test that the Unicode BOM does not confuse us?
$p = HTML::HeadParser->new(H->new);
@@ -177,4 +177,20 @@
is($p->header("title"), "Parkinson's disease");
is($p->header("link")->[0], '<../../css/ummAdam.css>; rel="stylesheet"; type="text/css"');
+
+ $p = HTML::HeadParser->new(H->new);
+ $p->utf8_mode(1);
+ $p->parse(<<"EOT"); # example from http://www.mjw.com.pl/
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> \r
+\r
+<head profile="http://gmpg.org/xfn/11">\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+\r
+<title> ko\xC5\x84c\xC3\xB3wki kolekcji, outlet, hurtownia odzie\xC5\xBCy Warszawa – MJW</title>\r
+<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />\r
+
+EOT
+ $p->eof;
+ is($p->header("title"), "ko\xC5\x84c\xC3\xB3wki kolekcji, outlet, hurtownia odzie\xC5\xBCy Warszawa \xE2\x80\x93 MJW");
}
More information about the Pkg-perl-cvs-commits
mailing list