texlive[66226] trunk: latexpand (27feb23)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 27 21:36:48 CET 2023


Revision: 66226
          http://tug.org/svn/texlive?view=revision&revision=66226
Author:   karl
Date:     2023-02-27 21:36:47 +0100 (Mon, 27 Feb 2023)
Log Message:
-----------
latexpand (27feb23)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand
    trunk/Master/texmf-dist/doc/support/latexpand/README
    trunk/Master/texmf-dist/doc/support/latexpand/version.txt
    trunk/Master/texmf-dist/scripts/latexpand/latexpand

Modified: trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand	2023-02-27 20:36:24 UTC (rev 66225)
+++ trunk/Build/source/texk/texlive/linked_scripts/latexpand/latexpand	2023-02-27 20:36:47 UTC (rev 66226)
@@ -86,7 +86,7 @@
 {
 	# $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 @@
 		# 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 @@
 
 =head1 VERSION
 
-This is latexpand version v1.7.
+This is latexpand version v1.7.2.

Modified: trunk/Master/texmf-dist/doc/support/latexpand/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexpand/README	2023-02-27 20:36:24 UTC (rev 66225)
+++ trunk/Master/texmf-dist/doc/support/latexpand/README	2023-02-27 20:36:47 UTC (rev 66226)
@@ -125,5 +125,5 @@
     https://lacl.fr/~caubert/notes/portabilite-du-tex.html#dependances
 
 VERSION
-    This is latexpand version v1.7.
+    This is latexpand version v1.7.2.
 

Modified: trunk/Master/texmf-dist/doc/support/latexpand/version.txt
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexpand/version.txt	2023-02-27 20:36:24 UTC (rev 66225)
+++ trunk/Master/texmf-dist/doc/support/latexpand/version.txt	2023-02-27 20:36:47 UTC (rev 66226)
@@ -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.

Modified: trunk/Master/texmf-dist/scripts/latexpand/latexpand
===================================================================
--- trunk/Master/texmf-dist/scripts/latexpand/latexpand	2023-02-27 20:36:24 UTC (rev 66225)
+++ trunk/Master/texmf-dist/scripts/latexpand/latexpand	2023-02-27 20:36:47 UTC (rev 66226)
@@ -86,7 +86,7 @@
 {
 	# $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 @@
 		# 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 @@
 
 =head1 VERSION
 
-This is latexpand version v1.7.
+This is latexpand version v1.7.2.



More information about the tex-live-commits mailing list.