Giter Club home page Giter Club logo

html-treebuilder-libxml's Introduction

GitHub Stats Card GitHub Top Languages Card

html-treebuilder-libxml's People

Contributors

cafe01 avatar creaktive avatar miyagawa avatar nihen avatar olegwtf avatar perlover avatar tokuhirom avatar yanick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

html-treebuilder-libxml's Issues

Improperly escapes <>& inside script tags

Calling as_HTML() on a tree that has a script tag will incorrectly encode the characters <>&, which results in invalid HTML.

$ perl -MHTML::TreeBuilder::LibXML\ 9999
HTML::TreeBuilder::LibXML version 9999 required--this is only version 0.26.
BEGIN failed--compilation aborted.

$ perl -Maliased=HTML::TreeBuilder::LibXML,T \
     -E 'my $t = T->new; $t->parse( q|<script>var a = 5 > 3 && 2 < 1;</script>| ); $t->eof; say $t->disembowel->as_HTML'
<script>var a = 5 &gt; 3 &amp;&amp; 2 &lt; 1;</script>

WWW::Mechanize::GZip interop problem

I have:

my $jar = HTTP::CookieJar::LWP->new;
my $mech = WWW::Mechanize::GZip->new( cookie_jar => $jar,  autocheck => 1, );
WWW::Mechanize::TreeBuilder->meta->apply($mech);
WWW::Mechanize::TreeBuilder->meta->apply($mech, tree_class => 'HTML::TreeBuilder::XPath');

And when running my script, I get the following error:

Use of uninitialized value in subroutine entry at <path>/perl5/perls/perl-5.34.0/lib/site_perl/5.34.0/HTML/TreeBuilder.pm line 108.

The error message is not emitted when I "downgrade" from WWW::Mechanize::GZip to vanilla WWW::Mechanize in the second line of the quoted code fagment. All modules are at the latest version.

version 0.18 again?

I've just used minil test, minil release, and it created version 0.18 instead of 0.19.
Is it a bug, or did I do something wrong?

Bad run-time dependency on Web::Scraper

0.23 META.json declares Web::Scraper as a run-time dependency. However, this is needed only for running tests:

$ grep -Hnr Web::Scraper
cpanfile:6:requires 'Web::Scraper';
META.yml:39:  Web::Scraper: 0
MYMETA.json:49:            "Web::Scraper" : "0",
README.md:31:Web::Scraper work.
README.md:37:        Web::Scraper: 0.26
t/02_web_scraper.t:6:plan skip_all => "this test requires Web::Scraper" unless eval "use Web::Scraper; 1";
t/02_web_scraper.t:21:use Web::Scraper;
MYMETA.yml:39:  Web::Scraper: 0
META.json:47:            "Web::Scraper" : "0",
lib/HTML/TreeBuilder/LibXML/Node.pm:88:# hack for Web::Scraper
lib/HTML/TreeBuilder/LibXML.pm:196:Web::Scraper work.
lib/HTML/TreeBuilder/LibXML.pm:202:        Web::Scraper: 0.26
tools/benchmark.pl:6:use Web::Scraper;
tools/benchmark.pl:17:print "Web::Scraper: $Web::Scraper::VERSION\n";
Changes:89:    * added workaround for Web::Scraper 0.36

Please move the Web::Scraper dependency from runtime requires to test requires.

t/05_empty.t fails with libxml2 2.9.12

After upgrading libxml2 from 2.9.10 to 2.9.12, t/05_empty.t test fails like this:

$ perl -Ilib t/05_empty.t 
1..15
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
not ok 9
#   Failed test at t/05_empty.t line 18.
#                   ''
#     doesn't match '(?^:<html>)'
ok 10
ok 11
not ok 12
#   Failed test at t/05_empty.t line 18.
#                   ''
#     doesn't match '(?^:<html>)'
ok 13
ok 14
not ok 15
#   Failed test at t/05_empty.t line 18.
#                   ''
#     doesn't match '(?^:<html>)'
# Looks like you failed 3 tests of 15.

Use of uninitialized value in subroutine entry warnings

Hi.

i got
Use of uninitialized value in subroutine entry at /Users/dan/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/HTML/TreeBuilder/LibXML/Node.pm line 160.

warning.

there is code to reproduce.

use strict;
use warnings;

use HTML::TreeBuilder::LibXML;

my $doc = <<'DOC';
<html>
    <body>
        <div>
            <div>a</div>
            <div>b</div>
        </div>
    </body>
</html>
DOC

my $tree = HTML::TreeBuilder::LibXML->new;
$tree->parse($doc);
$tree->eof;

my @nodes = $tree->findnodes("//body/div");

my $new_node = $nodes[0]->clone;

thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.