line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::latex_decode; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.18'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
244855
|
use Moo; |
|
1
|
|
|
|
|
12325
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
2014
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
172817
|
|
|
1
|
|
|
|
|
9
|
|
7
|
1
|
|
|
1
|
|
352
|
use Catmandu::Util qw(as_utf8); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1073
|
|
8
|
1
|
|
|
1
|
|
591
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
1183
|
|
|
1
|
|
|
|
|
57
|
|
9
|
1
|
|
|
1
|
|
502
|
use LaTeX::Decode; |
|
1
|
|
|
|
|
13091
|
|
|
1
|
|
|
|
|
86
|
|
10
|
1
|
|
|
1
|
|
10
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
11
|
1
|
|
|
1
|
|
840
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
964
|
|
|
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
|
|
19626
|
my ($self) = @_; |
20
|
2
|
|
|
|
|
10
|
my $opts = $self->opts; |
21
|
|
|
|
|
|
|
as_path($self->path) |
22
|
2
|
|
|
2
|
|
13
|
->updater(if_string => sub {latex_decode($_[0], %$opts)}); |
|
2
|
|
|
|
|
17825
|
|
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
|
|
|
|
|
|
|
~ |