Skip to content

Commit

Permalink
Fix bug in which $PAR doesn't produce a new line.
Browse files Browse the repository at this point in the history
  • Loading branch information
pstaabp committed Mar 27, 2024
1 parent 3cadd5d commit f139faf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/WeBWorK/PG/ConvertToPGML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ sub convertPGMLBlock {
my ($block) = @_;
my @new_rows;
for my $row (@$block) {
my $add_blank_line_before = ($row =~ /^\$PAR/);
my $add_blank_line_after = ($row =~ /\$PAR$/);
my $add_blank_line_before = ($row =~ /^\s*\$PAR/);
my $add_blank_line_after = ($row =~ /\$PAR\s*$/);
$row =~ s/(BEGIN|END)_TEXT/$1_PGML/;
$row =~ s/(BEGIN|END)_(SOLUTION|HINT)/$1_PGML_$2/;
$row =~ s/SOLUTION\(EV3P?\(<<\'END_PGML_SOLUTION\'\)\);/BEGIN_PGML_SOLUTION/;
Expand Down Expand Up @@ -168,7 +168,7 @@ sub convertPGMLBlock {
} elsif ($add_blank_line_before) {
push @new_rows, '', $row;
} elsif ($add_blank_line_after) {
push @new_rows, '', $row;
push @new_rows, $row, '';
} else {
push @new_rows, $row;
}
Expand Down

0 comments on commit f139faf

Please sign in to comment.