Stop wrapping math in <script type="math/tex">...</script>. (hotfix of #1500) - #1501
Open
drgrice1 wants to merge 1 commit into
Open
Stop wrapping math in <script type="math/tex">...</script>. (hotfix of #1500)#1501drgrice1 wants to merge 1 commit into
<script type="math/tex">...</script>. (hotfix of #1500)#1501drgrice1 wants to merge 1 commit into
Conversation
This used to be handled directly by MathJax long ago, but it no longer does so. Using `\(...\)` or `\[...\]` now works. So just do that. Also make sure that `&`, `<`, and `>` are properly HTML escaped. This actually gets done when the `post_process_content` method is called, but just in case the `general_math_ev3` method also does this. Note the `Mojo::DOM` parser is smart enough not to doubly escape these things. The script tag handling in the webwork2 `mathjax-config.js` file seems to be causing issues in some cases, and switching to using `\(...\)` or `\[...\]` fixes those issues. See openwebwork#1498 for details. It is also time to start doing some code clean up. I just did some minimal clean up of the `general_math_ev3` method.
somiaj
approved these changes
Aug 13, 2026
Contributor
|
Before anyone merges this, please give me a little more time to complete a test with PreTeXt. Should be able to do that later today. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This used to be handled directly by MathJax long ago, but it no longer does so. Using
\(...\)or\[...\]now works. So just do that. Also make sure that&,<, and>are properly HTML escaped. This actually gets done when thepost_process_contentmethod is called, but just in case thegeneral_math_ev3method also does this. Note theMojo::DOMparser is smart enough not to doubly escape these things.The script tag handling in the webwork2
mathjax-config.jsfile seems to be causing issues in some cases, and switching to using\(...\)or\[...\]fixes those issues. See #1498 for details.It is also time to start doing some code clean up. I just did some minimal clean up of the
general_math_ev3method.