lib/Markdown/Parser/Line.pm

filter: Statementstmt 68.4% 26 / 38 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 69.2% 9 / 13 Podpod 100% 4 / 4 totaltotal 66.1% 39 / 59 CC 3 SCAR 9.0
CC
3
Cov
62%
as_markdown
6.0
as_pod
6.0
init
2.0
CRAP 2.5
« blib/lib/Markdown/Parser/NewLine.pm ↑ Summary blib/lib/Markdown/Parser/FootnoteReference.pm »
1 ##----------------------------------------------------------------------------
2 ## Markdown Parser Only - ~/lib/Markdown/Parser/Line.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/08/23
7 ## Modified 2022/09/19
8 ## All rights reserved
9 ##
10 ## This program is free software; you can redistribute it and/or modify it
11 ## under the same terms as Perl itself.
12 ##----------------------------------------------------------------------------
13 package Markdown::Parser::Line;
14 BEGIN
15 {
16 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶ use parent qw( Markdown::Parser::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶ use Devel::Confess;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶ use constant TAB_SPACES => ' ';
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶ our $VERSION = 'v0.2.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 };
24  
25 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 sub init
29 {
30 0 ▶ my $self = shift( @_ );
Subroutine init: not called CC=1 SCAR=6.9
Pod documented
31 0 $self->{tag_name} = 'hr';
32 0 return( $self->SUPER::init( @_ ) );
33 }
34  
35 sub as_markdown
36 {
37 0 ▶ my $self = shift( @_ );
Subroutine as_markdown: not called CC=2 SCAR=17.9
Pod documented
38 0 ▶ return( $self->raw->scalar ) if( $self->raw->length );
Branch: 1 branch
BranchTrueFalseTotal
if $self->raw->length 0 0 0
39 0 return( '* * *' );
40 }
41  
42 sub as_pod
43 {
44 0 ▶ my $self = shift( @_ );
Subroutine as_pod: not called CC=2 SCAR=17.9
Pod documented
45 0 ▶ return( $self->raw->scalar ) if( $self->raw->length );
Branch: 1 branch
BranchTrueFalseTotal
if $self->raw->length 0 0 0
46 0 return( '-' x 12 );
47 }
48  
49 sub as_string
50 {
51 0 ▶ my $self = shift( @_ );
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
52 0 my $tag = 'hr';
53 0 return( "<$tag />" );
54 }
55  
56 1 1;
57 # NOTE: POD
58 __END__
« blib/lib/Markdown/Parser/NewLine.pm ↑ Summary blib/lib/Markdown/Parser/FootnoteReference.pm »