Subject: | parse drops whitespace at end of string |
Date: | Tue, 2 Aug 2011 14:05:02 +0200 |
To: | <bug-HTML-Parser [...] rt.cpan.org> |
From: | <g.zumstrull [...] rheinenergie.com> |
HTML::Parser 3.56
#!/usr/bin/perl
use strict;
use HTML::Parser ();
my $p = HTML::Parser->new(api_version => 3);
$p->handler(default => sub { print @_ }, "text");
print "<html>\n <body>";
$p->parse("\n <p>A sample paragraph</p>\n "); # note
whitespace at end of string
print "</body>\n</html>\n";
Should print:
<html>
<body>
<p>A sample paragraph</p>
</body>
</html>
But prints:
<html>
<body>
<p>A sample paragraph</p></body>
</html>