Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle nested braces in alignment specification #996

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions macros/ui/niceTables.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1282,10 +1282,10 @@ sub ParseAlignment {
$alignment =~ s/\R//g;

# first we parse things like *{20}{...} to expand them
my $pattern = qr/\*\{(\d+)\}\{(.*?)\}/;
my $pattern = qr/\*\{(\d+)\}(\{((?:(?>[^\{\}]+)|(?2))*)\})/;
while ($alignment =~ /$pattern/) {
my @captured = ($alignment =~ /$pattern/);
my $replaceWith = $captured[1] x $captured[0];
my $replaceWith = $captured[2] x $captured[0];
$alignment =~ s/$pattern/$replaceWith/;
}

Expand Down
Loading