| 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
| |||||||||||
| 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
| |||||||||||
| 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__ | ||||||||||