Markup/None.pm

filter: Statementstmt 100% 29 / 29 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 95.4% 42 / 44 CC 4 SCAR 5.5
CC
4
Cov
97%
parser
3.0
import
2.0
BEGIN
1.0
CRAP 1.7
« Markup/Creole.pm ↑ Summary Markup/Bbcode.pm »
1 package Text::Markup::None;
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 HTML::Entities;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use File::BOM qw(open_bom);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 our $VERSION = '0.43';
11  
12 5 ▶ sub import {
Subroutine import: called CC=2 SCAR=6.9
13 # Set a regex if passed one.
14 5 ▶ Text::Markup->register( none => $_[1] ) if $_[1];
Branch: 1 branch
BranchTrueFalseTotal
if $_[1] 1 4 5
15 }
16  
17 3 ▶sub parser {
Subroutine parser: called CC=3 SCAR=11.0
Pod undocumented
18 3 my ($file, $encoding, $opts) = @_;
19 3 open_bom my $fh, $file, ":encoding($encoding)";
20 3 local $/;
21 3 my $html = encode_entities(<$fh>, '<>&"');
22 3 ▶ return undef unless $html =~ /\S/;
Branch: 1 branch
BranchTrueFalseTotal
unless $html =~ /\S/ 1 2 3
23 2 utf8::encode($html);
24 2 ▶ return $html if { @{ $opts } }->{raw};
Branch: 1 branch
BranchTrueFalseTotal
if {@{$opts;}}->{"raw"} 0 2 2
25 2 return qq{<html>
26 <head>
27 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
28 </head>
29 <body>
30 <pre>$html</pre>
31 </body>
32 </html>
33 };
34 }
35  
36 2 1;
37 __END__
« Markup/Creole.pm ↑ Summary Markup/Bbcode.pm »