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