Create a gist now

Instantly share code, notes, and snippets.

anonymous /
Created Oct 5, 2012

What would you like to do?
HTML4 comment parsing issue with Mojo::DOM
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Mojo::DOM;
use HTML::TreeBuilder;
my $content = <<'EOF';
<!-- This is a valid comment -- >
<p>Here's a paragraph</p>
my $dom = Mojo::DOM->new( $content );
say "Mojo:\n" . $dom;
my $dom = HTML::TreeBuilder->new_from_content($content);
say "Tree:\n" . $dom->as_HTML('<>&', ' ');
<!-- -- a comment is this valid>
<p>Here&#39;s a paragraph</p>
<p>Here's a paragraph</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment