Markup/Pod.pm

filter: Statementstmt 100% 35 / 35 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 96.0% 48 / 50 CC 5 SCAR 7.7
CC
5
Cov
98%
parser
4.0
import
2.0
BEGIN
1.0
CRAP 2.2
« Markup/Markdown.pm ↑ Summary Markup/HTML.pm »
1 package Text::Markup::Pod;
2  
3 2 ▶use 5.8.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Text::Markup;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Pod::Simple::XHTML 3.15;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶sub import {
Subroutine import: called CC=2 SCAR=6.9
10 # Replace the regex if passed one.
11 3 ▶ Text::Markup->register( pod => $_[1] ) if $_[1];
Branch: 1 branch
BranchTrueFalseTotal
if $_[1] 2 1 3
12 }
13  
14 # Disable the use of HTML::Entities.
15 2 $Pod::Simple::XHTML::HAS_HTML_ENTITIES = 0;
16  
17 2 our $VERSION = '0.43';
18  
19 4 ▶sub parser {
Subroutine parser: called CC=4 SCAR=13.9
Pod undocumented
20 4 my ($file, $encoding, $opts) = @_;
21 4 my $p = Pod::Simple::XHTML->new;
22 # Output everything as UTF-8.
23 4 $p->html_header_tags('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />');
24 4 ▶ $p->strip_verbatim_indent(sub { (sort map { /^(\s+)/ } @{$_[0]})[0] });
Subroutine __ANON__: called CC=1 SCAR=0.0
25 4 $p->html_encode_chars('&<>">');
26 4 $p->output_string(\my $html);
27 # Want user supplied options to override even these default behaviors,
28 # if necessary
29 4 ▶ my $opt = $opts ? { @$opts } : {};
Branch: 1 branch
BranchTrueFalseTotal
$opts ? : 4 0 4
30 4 foreach my $method ( keys %$opt ) {
31 3 my $v = $opt->{$method};
32 3 $p->$method($v);
33 }
34 4 $p->parse_file($file);
35 4 ▶ return unless $p->content_seen;
Branch: 1 branch
BranchTrueFalseTotal
unless $p->content_seen 1 3 4
36 3 utf8::encode($html);
37 3 return $html;
38 }
39  
40 2 1;
41 __END__
« Markup/Markdown.pm ↑ Summary Markup/HTML.pm »