Parser/Line.pm

filter: Statementstmt 65.7% 23 / 35 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 8 / 12 Podpod 100% 4 / 4 totaltotal 63.6% 35 / 55 CC 3 SCAR 9.4
CC
3
Cov
59%
as_markdown
6.0
as_pod
6.0
init
2.0
CRAP 2.6
« Parser/NewLine.pm ↑ Summary Parser/FootnoteReference.pm »
1 ##----------------------------------------------------------------------------
2 ## Markdown Parser Only - ~/lib/Markdown/Parser/Line.pm
3 ## Version v0.3.0
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/08/23
7 ## Modified 2024/08/30
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 1 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
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 constant TAB_SPACES => ' ';
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 our $VERSION = 'v0.3.0';
22 };
23  
24 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 sub init
28 0 ▶{
Subroutine init: not called CC=1 SCAR=6.9
Pod documented
29 0 my $self = shift( @_ );
30 0 $self->{tag_name} = 'hr';
31 0 return( $self->SUPER::init( @_ ) );
32 }
33  
34 sub as_markdown
35 0 ▶{
Subroutine as_markdown: not called CC=2 SCAR=17.9
Pod documented
36 0 my $self = shift( @_ );
37 0 ▶ return( $self->raw->scalar ) if( $self->raw->length );
Branch: 1 branch
BranchTrueFalseTotal
if $self->raw->length 0 0 0
38 0 return( '* * *' );
39 }
40  
41 sub as_pod
42 0 ▶{
Subroutine as_pod: not called CC=2 SCAR=17.9
Pod documented
43 0 my $self = shift( @_ );
44 0 ▶ return( $self->raw->scalar ) if( $self->raw->length );
Branch: 1 branch
BranchTrueFalseTotal
if $self->raw->length 0 0 0
45 0 return( '-' x 12 );
46 }
47  
48 sub as_string
49 0 ▶{
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
50 0 my $self = shift( @_ );
51 0 my $tag = 'hr';
52 0 return( "<$tag />" );
53 }
54  
55 1 1;
56 # NOTE: POD
57 __END__
« Parser/NewLine.pm ↑ Summary Parser/FootnoteReference.pm »