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

Conversation

drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Aug 22, 2023

Here is a minimal working example to demonstrate the change:

DOCUMENT();
loadMacros('PGstandard.pl');
BEGIN_TEXT
\{ foo() \}
END_TEXT
ENDDOCUMENT();

Also remove the $PAR's around the output when these errors occur. This makes the output look more like the code to begin with.

With the develop branch the warning messages for this problem will be:

  • 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:
  • ## foo()
  • ##Undefined subroutine &main::foo called at line 1 of (eval 7649).
  • ##</PRE><BR>
  • at line 2080 of [PG]/macros/core/PGbasicmacros.pl.

Since these warnings are now xml escaped by webwork2 the html formatting no longer works.

With this branch they will be:

  • There is an error occuring inside evaluation brackets \{ ...code... \}
  • somewhere in an EV2, EV3, or BEGIN_TEXT block.
  • Code evaluated:
  • foo()
  • Errors:
  • Undefined subroutine &main::foo called at line 1 of (eval 7742).

I don't think that the "ERROR in old_safe_ev, PGbasicmacros.pl" part is useful for problem authors, so that was dropped.

Also remove the ; from the end of the eval, and the comment about it. Testing shows that comment is false.

Here is a minimal working example to demonstrate the change:
```perl
DOCUMENT();
loadMacros('PGstandard.pl');
BEGIN_TEXT
\{ foo() \}
END_TEXT
ENDDOCUMENT();
```
Also remove the `$PAR` around the output when these errors occur. This
makes the output look more like the code to begin with.

With the develop branch the warning messages for this problem will be:

* `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:`
* `## foo()`
* `##Undefined subroutine &main::foo called at line 1 of (eval 7649).`
* `##</PRE><BR>`
* `at line 2080 of [PG]/macros/core/PGbasicmacros.pl.`

Since these warnings are now xml escaped by webwork2 the html formatting
no longer works.

With this branch they will be:

* `There is an error occuring inside evaluation brackets \{ ...code... \}`
* `somewhere in an EV2, EV3, or BEGIN_TEXT block.`
* `Code evaluated:`
* `foo()`
* `Errors:`
* `Undefined subroutine &main::foo called at line 1 of (eval 7742).`

I don't think that the "ERROR in old_safe_ev, PGbasicmacros.pl" part is
useful for problem authors, so that was dropped.

Also remove the `;` from the end of the eval, and the comment about it.
Testing shows that comment is false.
@drgrice1 drgrice1 force-pushed the remove-more-html-in-warn branch from 5413c17 to f0bcfd2 Compare August 23, 2023 00:05
@Alex-Jordan Alex-Jordan merged commit 55f7b50 into openwebwork:develop Aug 24, 2023
@drgrice1 drgrice1 deleted the remove-more-html-in-warn branch October 2, 2023 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants