File Coverage

blib/lib/Text/Markup/HTML.pm
Criterion Covered Total %
statement 18 18 100.0
branch 5 6 83.3
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 29 31 93.5


line stmt bran cond sub pod time code
1             package Text::Markup::HTML;
2              
3 1     1   9570 use 5.8.1;
  1         3  
4 1     1   4 use strict;
  1         1  
  1         35  
5 1     1   4 use warnings;
  1         2  
  1         132  
6 1     1   7 use Text::Markup;
  1         1  
  1         231  
7              
8             our $VERSION = '0.41';
9              
10             sub import {
11             # Replace the regex if passed one.
12 3 100   3   38 Text::Markup->register( html => $_[1] ) if $_[1];
13             }
14              
15             sub parser {
16 2     2 0 5 my ($file, $encoding, $opts) = @_;
17 2         4 my $html = do {
18 2 50       114 open my $fh, '<:raw', $file or die "Cannot open $file: $!\n";
19 2         11 local $/;
20 2         211 <$fh>;
21             };
22 2 100       25 return $html =~ /\S/ ? $html : undef
23             }
24              
25             1;
26             __END__