line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::latex_decode; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.21'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
219853
|
use Moo; |
|
1
|
|
|
|
|
11033
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
1918
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
169497
|
|
|
1
|
|
|
|
|
9
|
|
7
|
1
|
|
|
1
|
|
339
|
use Catmandu::Util qw(as_utf8); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
8
|
1
|
|
|
1
|
|
1136
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
1184
|
|
|
1
|
|
|
|
|
59
|
|
9
|
1
|
|
|
1
|
|
550
|
use LaTeX::Decode; |
|
1
|
|
|
|
|
11991
|
|
|
1
|
|
|
|
|
93
|
|
10
|
1
|
|
|
1
|
|
8
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
11
|
1
|
|
|
1
|
|
1431
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
991
|
|
|
1
|
|
|
|
|
6
|
|
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
|
|
17743
|
my ($self) = @_; |
20
|
2
|
|
|
|
|
13
|
my $opts = $self->opts; |
21
|
|
|
|
|
|
|
as_path($self->path) |
22
|
2
|
|
|
2
|
|
16
|
->updater(if_string => sub {latex_decode($_[0], %$opts)}); |
|
2
|
|
|
|
|
18457
|
|
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
|
|
|
|
|
|
|
~ |