Skip to content

Commit

Permalink
Call $tree->no_expand_entities(1) to avoid HTML entities decoded.fix m…
Browse files Browse the repository at this point in the history
  • Loading branch information
mizzy committed Jan 12, 2012
1 parent 89a43e4 commit e61b659
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webiblo.pl
Expand Up @@ -85,11 +85,14 @@ sub get_content {
mirror($uri, "tmp/$file") unless -f "tmp/$file";

my $tree = HTML::TreeBuilder::XPath->new;
$tree->no_expand_entities(1);
$tree->parse_file("tmp/$file");
$tree->eof;

if ( $book->{content_xpath} ) {
my $content = ($tree->findnodes($book->{content_xpath}))[0];
$tree = HTML::TreeBuilder::XPath->new;
$tree->no_expand_entities(1);
$tree->parse($content->as_XML);
$tree->eof;
}
Expand Down

0 comments on commit e61b659

Please sign in to comment.