line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::latex_decode; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.20'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
250050
|
use Moo; |
|
1
|
|
|
|
|
13689
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
2551
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
201330
|
|
|
1
|
|
|
|
|
9
|
|
7
|
1
|
|
|
1
|
|
375
|
use Catmandu::Util qw(as_utf8); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
68
|
|
8
|
1
|
|
|
1
|
|
1189
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
1474
|
|
|
1
|
|
|
|
|
69
|
|
9
|
1
|
|
|
1
|
|
610
|
use LaTeX::Decode; |
|
1
|
|
|
|
|
14172
|
|
|
1
|
|
|
|
|
122
|
|
10
|
1
|
|
|
1
|
|
13
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
11
|
1
|
|
|
1
|
|
1285
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
1106
|
|
|
1
|
|
|
|
|
7
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
16
|
|
|
|
|
|
|
has opts => (fix_opt => 'collect'); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _build_fixer { |
19
|
2
|
|
|
2
|
|
18792
|
my ($self) = @_; |
20
|
2
|
|
|
|
|
8
|
my $opts = $self->opts; |
21
|
|
|
|
|
|
|
as_path($self->path) |
22
|
2
|
|
|
2
|
|
13
|
->updater(if_string => sub {latex_decode($_[0], %$opts)}); |
|
2
|
|
|
|
|
19254
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=encoding utf8 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Catmandu::Fix::latex_decode - decode test from LaTeX to Unicode |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# decode the latex string in field 'foo'. E.g. foo => 'b\\"ar' |
40
|
|
|
|
|
|
|
latex_decode(foo) # foo => 'bär' |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SEE ALSO |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
L<Catmandu::Fix> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
~ |