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

Remove html formatting in a warn statement. #919

Merged
merged 1 commit into from
Aug 24, 2023
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
21 changes: 8 additions & 13 deletions macros/core/PGbasicmacros.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2072,23 +2072,18 @@ sub safe_ev {

sub old_safe_ev {
my $in = shift;
my ($out, $PG_eval_errors, $PG_full_error_report) = PG_restricted_eval("$in;");
# the addition of the ; seems to provide better error reporting
my ($out, $PG_eval_errors, $PG_full_error_report) = PG_restricted_eval($in);
if ($PG_eval_errors) {
my @errorLines = split("\n", $PG_eval_errors);
#$out = "<PRE>$PAR % ERROR in $0:old_safe_ev, PGbasicmacros.pl: $PAR % There is an error occuring inside evaluation brackets \\{ ...code... \\} $BR % somewhere in an EV2 or EV3 or BEGIN_TEXT block. $BR % Code evaluated:$BR $in $BR % $BR % $errorLines[0]\n % $errorLines[1]$BR % $BR % $BR </PRE> ";
warn " ERROR in old_safe_ev, PGbasicmacros.pl: <PRE>
## There is an error occuring inside evaluation brackets \\{ ...code... \\}
## somewhere in an EV2 or EV3 or BEGIN_TEXT block.
## Code evaluated:
## $in
##" . join("\n ", @errorLines) . "
##</PRE>$BR
";
$out = "$PAR $BBOLD $in $EBOLD $PAR";
warn "There is an error occuring inside evaluation brackets \\{ ...code... \\}\n"
. "somewhere in an EV2, EV3, or BEGIN_TEXT block.\n"
. "Code evaluated:\n$in\n"
. "Errors:\n"
. join("\n", @errorLines) . "\n";
$out = "$BBOLD$in$EBOLD";
}

($out, $PG_eval_errors, $PG_full_error_report);
return ($out, $PG_eval_errors, $PG_full_error_report);
}

sub FEQ { # Format EQuations
Expand Down