diff options
author | Norbert Preining <norbert@preining.info> | 2023-02-28 03:02:32 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-02-28 03:02:32 +0000 |
commit | ed106ad4cb2e3cb0269bdc9f721ff75df77532cf (patch) | |
tree | 4cbe8c477935516497526c9a01ed2ab240c782bb /support/latexpand | |
parent | 86d5a04282aa958addab4585c4df899ec9a92e50 (diff) |
CTAN sync 202302280302
Diffstat (limited to 'support/latexpand')
-rw-r--r-- | support/latexpand/README | 2 | ||||
-rwxr-xr-x | support/latexpand/latexpand | 19 | ||||
-rw-r--r-- | support/latexpand/version.txt | 4 |
3 files changed, 17 insertions, 8 deletions
diff --git a/support/latexpand/README b/support/latexpand/README index 8933efb074..dbd4647530 100644 --- a/support/latexpand/README +++ b/support/latexpand/README @@ -125,5 +125,5 @@ SEE ALSO https://lacl.fr/~caubert/notes/portabilite-du-tex.html#dependances VERSION - This is latexpand version v1.7. + This is latexpand version v1.7.2. diff --git a/support/latexpand/latexpand b/support/latexpand/latexpand index ee97a46a09..c30e5aacb5 100755 --- a/support/latexpand/latexpand +++ b/support/latexpand/latexpand @@ -86,7 +86,7 @@ sub get_version { # $VERSION's value will be substituted by 'make dist', but the # next line won't (the string has to be broken to avoid it). - my $VERSION = 'v1.7'; + my $VERSION = 'v1.7.2'; if ($VERSION eq '@LATEXPAND' . '_VERSION@') { my($vol,$dir,$file) = File::Spec->splitpath($0); chdir($dir); @@ -248,10 +248,19 @@ sub process_line # Escaping these '%' is not mandatory, but allowed, hence we can # pre-process the line by escaping them, and let latexpand work # as normal afterwards. + # Known limitation: latexpand doesn't do balanced braces + # recognition, and just refuses both { and } within \url{} + # argument for %-detection to work ([^{}%] below). Fix should be + # possible using + # https://stackoverflow.com/questions/15301708/perl-regular-expression-match-nested-brackets + # but is it worth the trouble? (file an issue or send a merge + # request if you think it is) + # While there are \url{URL} with unescaped % in URL ... - while (/^(.*\\url\{)(([^\\]%|[^}%])*)(\}.*)$/) { - my ($before, $url, $after) = ($1, $2, $4); - # escape unescaped % in URL + my $NON_PERCENT = '([^\\}]%|[^{}%])*'; + while (/^(?<before>.*\\url\{)(?<url>$NON_PERCENT[^\\}]%$NON_PERCENT)(?<after>\}.*)$/) { + my ($before, $url, $after) = ($+{before}, $+{url}, $+{after}); + # escape unescaped % in URL, if any $url =~ s/([^\\])%/$1\\%/g; $_ = $before . $url . $after ."\n"; } @@ -701,4 +710,4 @@ https://lacl.fr/~caubert/notes/portabilite-du-tex.html#dependances =head1 VERSION -This is latexpand version v1.7. +This is latexpand version v1.7.2. diff --git a/support/latexpand/version.txt b/support/latexpand/version.txt index 42952ccf83..cc2e97f667 100644 --- a/support/latexpand/version.txt +++ b/support/latexpand/version.txt @@ -1,2 +1,2 @@ -latexpand version v1.7 (6c1d8d9e3b331247ab09bc533a4360ea37deead5). -Committed on Fri Feb 24 10:40:17 2023 +0100. +latexpand version v1.7.2 (4a76237c217a532a77044c0346b1e06648814531). +Committed on Mon Feb 27 09:52:54 2023 +0100. |