line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Microformat::Plugin::Parser::HTML; |
2
|
4
|
|
|
4
|
|
9405
|
use HTML::TreeBuilder; |
|
4
|
|
|
|
|
171199
|
|
|
4
|
|
|
|
|
53
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
sub html_to_tree { |
5
|
20
|
|
|
20
|
0
|
289
|
my $c = shift; |
6
|
20
|
|
|
|
|
41
|
my $content = shift; |
7
|
20
|
|
|
|
|
177
|
my $tree = HTML::TreeBuilder->new; |
8
|
20
|
|
|
|
|
5816
|
while (my ($k,$v) = each %{$c->plugin_opts}) { |
|
40
|
|
|
|
|
148
|
|
9
|
20
|
50
|
|
|
|
443
|
$tree->$k($v) if $tree->can($k); |
10
|
|
|
|
|
|
|
} |
11
|
20
|
|
|
|
|
286
|
$tree->parse_content($content); |
12
|
20
|
|
|
|
|
81057
|
return $tree; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub parse { |
16
|
20
|
|
|
20
|
0
|
4238
|
my $c = shift; |
17
|
20
|
50
|
33
|
|
|
103
|
if (!$c->tree and $c->opts->{content_type} =~ /html/i) { |
18
|
20
|
|
|
|
|
771
|
$c->tree($c->html_to_tree($c->content)); |
19
|
|
|
|
|
|
|
} |
20
|
20
|
|
|
|
|
497
|
return $c->NEXT::parse(@_); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Text::Microformat::Plugin::Parser::HTML - HTML parser plugin for Text::Microformat |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SEE ALSO |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
L |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 AUTHOR |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Keith Grennan, C<< >> |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 BUGS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Log bugs and feature requests here: L |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SUPPORT |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Project homepage: L |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Copyright 2007 Keith Grennan, all rights reserved. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
48
|
|
|
|
|
|
|
under the same terms as Perl itself. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |