line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
804
|
use 5.006; # our |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
104
|
|
2
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
152
|
|
3
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
212
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package CPAN::Changes::Markdown::Filter::Rule::UnderscoredToCode; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Quote things containing an underscore as Code |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.000001'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
464
|
use Moo qw( with ); |
|
3
|
|
|
|
|
10657
|
|
|
3
|
|
|
|
|
19
|
|
14
|
3
|
|
|
3
|
|
2105
|
use CPAN::Changes::Markdown::Filter::NodeUtil qw( mk_node_plaintext mk_node_delimitedtext ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
22
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
with 'CPAN::Changes::Markdown::Role::Filter::Rule::PlainText'; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# _Pulp__5010_qr_m_propagate_properly |
42
|
|
|
|
|
|
|
## no critic (Compatibility::PerlMinimumVersionAndWhy) |
43
|
|
|
|
|
|
|
my $re_prefix = qr/(\A|\A.*?\s) ( _+ [^_\s]+ (?: _+ [^_\s]+ )* ) (\z|\s.*\z)/msx; |
44
|
|
|
|
|
|
|
my $re_suffix = qr/(\A|\A.*?\s) ( [^_\s]+ _+ (?: [^_\s]+ _+ )* ) (\z|\s.*\z)/msx; |
45
|
|
|
|
|
|
|
my $re_infix = qr/(\A|\A.*?\s) ( [^_\s]+ _+ [^_\s]+ (?: _+ [^_\s]+ )* ) (\z|\s.*\z)/msx; |
46
|
|
|
|
|
|
|
## use critic |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _inject_code_delim { |
49
|
12
|
|
|
12
|
|
28
|
my ( $self, $out, $before, $code, $after ) = @_; |
50
|
12
|
|
|
|
|
12
|
push @{$out}, mk_node_plaintext($before); |
|
12
|
|
|
|
|
29
|
|
51
|
12
|
|
|
|
|
188
|
push @{$out}, mk_node_delimitedtext( q{`}, $code, q{`} ); |
|
12
|
|
|
|
|
31
|
|
52
|
12
|
|
|
|
|
2131
|
push @{$out}, $self->filter_plaintext( mk_node_plaintext($after) ); |
|
12
|
|
|
|
|
29
|
|
53
|
12
|
|
|
|
|
14
|
return @{$out}; |
|
12
|
|
|
|
|
49
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub filter_plaintext { |
61
|
30
|
|
|
30
|
1
|
193
|
my ( $self, $input ) = @_; |
62
|
30
|
100
|
|
|
|
161
|
if ( $input->content =~ $re_prefix ) { |
63
|
2
|
|
|
|
|
6
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
64
|
|
|
|
|
|
|
} |
65
|
28
|
100
|
|
|
|
117
|
if ( $input->content =~ $re_suffix ) { |
66
|
2
|
|
|
|
|
5
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
67
|
|
|
|
|
|
|
} |
68
|
26
|
100
|
|
|
|
84
|
if ( $input->content =~ $re_infix ) { |
69
|
8
|
|
|
|
|
20
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
70
|
|
|
|
|
|
|
} |
71
|
18
|
|
|
|
|
38
|
return $input; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |