diff options
Diffstat (limited to 'Master/texmf-dist/scripts/bibtexperllibs/LaTeX/ToUnicode.pm')
-rw-r--r-- | Master/texmf-dist/scripts/bibtexperllibs/LaTeX/ToUnicode.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Master/texmf-dist/scripts/bibtexperllibs/LaTeX/ToUnicode.pm b/Master/texmf-dist/scripts/bibtexperllibs/LaTeX/ToUnicode.pm index b11ded80e41..cf62cf5a29d 100644 --- a/Master/texmf-dist/scripts/bibtexperllibs/LaTeX/ToUnicode.pm +++ b/Master/texmf-dist/scripts/bibtexperllibs/LaTeX/ToUnicode.pm @@ -2,7 +2,7 @@ use strict; use warnings; package LaTeX::ToUnicode; BEGIN { - $LaTeX::ToUnicode::VERSION = '0.04'; + $LaTeX::ToUnicode::VERSION = '0.05'; } #ABSTRACT: Convert LaTeX commands to Unicode @@ -29,10 +29,10 @@ sub convert { sub _convert_accents { my $string = shift; - $string =~ s/({\\(.){(\\?\w{1,2})}})/$LaTeX::ToUnicode::Tables::ACCENTS{$2}{$3} || $1/eg; # {\"{a}} - $string =~ s/({\\(.)(\\?\w{1,2})})/$LaTeX::ToUnicode::Tables::ACCENTS{$2}{$3} || $1/eg; # {\"a} + $string =~ s/(\{\\(.)\{(\\?\w{1,2})\}\})/$LaTeX::ToUnicode::Tables::ACCENTS{$2}{$3} || $1/eg; # {\"{a}} + $string =~ s/(\{\\(.)(\\?\w{1,2})\})/$LaTeX::ToUnicode::Tables::ACCENTS{$2}{$3} || $1/eg; # {\"a} $string =~ s/(\\(.)(\\?\w{1,2}))/$LaTeX::ToUnicode::Tables::ACCENTS{$2}{$3} || $1/eg; # \"a - $string =~ s/(\\(.){(\\?\w{1,2})})/$LaTeX::ToUnicode::Tables::ACCENTS{$2}{$3} || $1/eg; # \"{a} + $string =~ s/(\\(.)\{(\\?\w{1,2})\})/$LaTeX::ToUnicode::Tables::ACCENTS{$2}{$3} || $1/eg; # \"{a} $string; } @@ -49,7 +49,7 @@ sub _convert_commands { my $string = shift; foreach my $command ( keys %LaTeX::ToUnicode::Tables::COMMANDS ) { - $string =~ s/{\\$command}/$LaTeX::ToUnicode::Tables::COMMANDS{$command}/g; + $string =~ s/\{\\$command\}/$LaTeX::ToUnicode::Tables::COMMANDS{$command}/g; $string =~ s/\\$command(?=\s|\b)/$LaTeX::ToUnicode::Tables::COMMANDS{$command}/g; } @@ -79,8 +79,8 @@ sub _convert_markups { my $string = shift; my $markups = join( '|', @LaTeX::ToUnicode::Tables::MARKUPS ); - $string =~ s/({[^{}]+)\\(?:$markups)\s+([^{}]+})/$1$2/g; # { ... \command ... } - my $pattern = qr/{\\(?:$markups)\s+([^{}]*)}/o; + $string =~ s/(\{[^{}]+)\\(?:$markups)\s+([^{}]+\})/$1$2/g; # { ... \command ... } + my $pattern = qr/\{\\(?:$markups)\s+([^{}]*)\}/o; $string =~ s/$pattern/$1/g; $string =~ s/``/“/g; @@ -103,7 +103,7 @@ LaTeX::ToUnicode - Convert LaTeX commands to Unicode =head1 VERSION -version 0.04 +version 0.05 =head1 SYNOPSIS |