summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/latexindent
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-09-24 20:23:55 +0000
committerKarl Berry <karl@freefriends.org>2023-09-24 20:23:55 +0000
commit9385e3dde9ffb6ffc7dcb555b9d4bc0afd1d47b4 (patch)
treec87bee9016ce1f400b571fda48ce291ea6df633c /Master/texmf-dist/scripts/latexindent
parentb09150849931baaa9c7f1ad7da5edd34be19713d (diff)
latexindent (24sep23)
git-svn-id: svn://tug.org/texlive/trunk@68362 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent')
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm27
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm4
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/defaultSettings.yaml9
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/latexindent.pl2
4 files changed, 25 insertions, 17 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
index f68db3400ba..096d2935c96 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
@@ -71,14 +71,23 @@ sub construct_special_begin {
next;
}
+ # body of specialBeginEnd
+ my $specialBodyRegEx = q();
+ if ( defined ${$BeginEnd}{body} ) {
+ $specialBodyRegEx = qr/${$BeginEnd}{body}/;
+ }
+ else {
+ $specialBodyRegEx = qr/(?: # cluster-only (), don't capture
+ (?!
+ (?:$specialBegins) # cluster-only (), don't capture
+ ). # any character, but not anything in $specialBegins
+ )*?/sx;
+ }
+
# the overall regexp
$specialAllMatchesRegExp .= ( $specialAllMatchesRegExp eq "" ? q() : "|" ) . qr/
${$BeginEnd}{begin}
- (?: # cluster-only (), don't capture
- (?!
- (?:$specialBegins) # cluster-only (), don't capture
- ). # any character, but not anything in $specialBegins
- )*?
+ $specialBodyRegEx
${$BeginEnd}{end}
/sx;
@@ -90,11 +99,7 @@ sub construct_special_begin {
(\R*)?
)
(
- (?: # cluster-only (), don't capture
- (?!
- (?:$specialBegins) # cluster-only (), don't capture
- ). # any character, but not anything in $specialBegins
- )*?
+ $specialBodyRegEx
(\R*)?
)
(
@@ -252,6 +257,8 @@ sub tasks_particular_to_each_object {
}
+ $self->find_special;
+
return unless ( ${ $mainSettings{specialBeginEnd} }{specialBeforeCommand} );
# lookForAlignDelims: lookForChildCodeBlocks set to 0 means no child objects searched for
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
index 6da4d24cf77..684b37c3c9a 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
@@ -20,6 +20,6 @@ use warnings;
use Exporter qw/import/;
our @EXPORT_OK = qw/$versionNumber $versionDate/;
-our $versionNumber = '3.23.1';
-our $versionDate = '2023-09-13';
+our $versionNumber = '3.23.2';
+our $versionDate = '2023-09-23';
1
diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
index 8ee2b7a2fb5..a3c04edf3af 100755
--- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
+++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
@@ -1,5 +1,5 @@
#
-# latexindent.pl, version 3.23.1, 2023-09-13
+# latexindent.pl, version 3.23.2, 2023-09-23
#
# defaultSettings.yaml, the default settings for latexindent.pl
#
@@ -258,15 +258,16 @@ itemNames:
specialBeginEnd:
displayMath:
begin: (?<!\\)\\\[ # \[ but *not* \\[
- end: \\\] # \]
+ end: \\\] # \]
lookForThis: 1
inlineMath:
begin: (?<!\$)(?<!\\)\$(?!\$) # $ but *not* \$ or $$
- end: (?<!\\)\$(?!\$) # $ but *not* \$ or $$
+ body: [^$]*? # anything *except* $
+ end: (?<!\\)\$(?!\$) # $ but *not* \$ or $$
lookForThis: 1
displayMathTeX:
begin: \$\$ # $$
- end: \$\$ # $$
+ end: \$\$ # $$
lookForThis: 1
specialBeforeCommand: 0
diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl
index 50b94939fff..f8bcf3503e0 100755
--- a/Master/texmf-dist/scripts/latexindent/latexindent.pl
+++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
-# latexindent.pl, version 3.23.1, 2023-09-13
+# latexindent.pl, version 3.23.2, 2023-09-23
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by