Skip to content

Stop wrapping math in <script type="math/tex">...</script>. (hotfix of #1500) - #1501

Open
drgrice1 wants to merge 1 commit into
openwebwork:mainfrom
drgrice1:mathjax-no-script-tags-hotfix
Open

Stop wrapping math in <script type="math/tex">...</script>. (hotfix of #1500)#1501
drgrice1 wants to merge 1 commit into
openwebwork:mainfrom
drgrice1:mathjax-no-script-tags-hotfix

Conversation

@drgrice1

Copy link
Copy Markdown
Member

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 #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.

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.
@Alex-Jordan

Copy link
Copy Markdown
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.

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