line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
496
|
use 5.006; # our |
|
3
|
|
|
|
|
7
|
|
2
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
71
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
272
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package CPAN::Changes::Markdown::Filter::Rule::UnderscoredToCode; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Quote things containing an underscore as Code |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.000002'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
417
|
use Moo qw( with ); |
|
3
|
|
|
|
|
9221
|
|
|
3
|
|
|
|
|
23
|
|
14
|
3
|
|
|
3
|
|
1948
|
use CPAN::Changes::Markdown::Filter::NodeUtil qw( mk_node_plaintext mk_node_delimitedtext ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
21
|
|
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
|
|
48
|
my ( $self, $out, $before, $code, $after ) = @_; |
50
|
12
|
|
|
|
|
14
|
push @{$out}, mk_node_plaintext($before); |
|
12
|
|
|
|
|
33
|
|
51
|
12
|
|
|
|
|
190
|
push @{$out}, mk_node_delimitedtext( q{`}, $code, q{`} ); |
|
12
|
|
|
|
|
66
|
|
52
|
12
|
|
|
|
|
2530
|
push @{$out}, $self->filter_plaintext( mk_node_plaintext($after) ); |
|
12
|
|
|
|
|
35
|
|
53
|
12
|
|
|
|
|
15
|
return @{$out}; |
|
12
|
|
|
|
|
54
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub filter_plaintext { |
61
|
30
|
|
|
30
|
1
|
202
|
my ( $self, $input ) = @_; |
62
|
30
|
100
|
|
|
|
221
|
if ( $input->content =~ $re_prefix ) { |
63
|
2
|
|
|
|
|
9
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
64
|
|
|
|
|
|
|
} |
65
|
28
|
100
|
|
|
|
146
|
if ( $input->content =~ $re_suffix ) { |
66
|
2
|
|
|
|
|
7
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
67
|
|
|
|
|
|
|
} |
68
|
26
|
100
|
|
|
|
113
|
if ( $input->content =~ $re_infix ) { |
69
|
8
|
|
|
|
|
22
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
70
|
|
|
|
|
|
|
} |
71
|
18
|
|
|
|
|
33
|
return $input; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |