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

Wrap math content in <script type="math/tex"></script> tags for MathJax #564

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Apr 14, 2021

This is a replacement for @Alex-Jordan's previous attempt #563.

This is paired with openwebwork/webwork2#1322 and won't work without it.

@drgrice1 drgrice1 changed the title Wrap math content in `<script type="math/tex"></script" tags for MathJax Wrap math content in <script type="math/tex"></script> tags for MathJax Apr 14, 2021
@Alex-Jordan Alex-Jordan self-requested a review April 15, 2021 04:04
Copy link
Contributor

@Alex-Jordan Alex-Jordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These work for me.

There is a bonus improvement. Before when the page first loads, you see the unprocessed math content for a second before MathJax processes. With this, the script tag content is not visible until the math is processed. I think that is an improvement, although it's worth noting that the rest of the text will tend to move more now that there is not unprocessed math serving as a placeholder.

@pstaabp pstaabp self-requested a review April 15, 2021 10:54
Copy link
Member

@dpvc dpvc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One unnecessary <span>, but other than that, OK.

macros/PGbasicmacros.pl Outdated Show resolved Hide resolved
@pstaabp pstaabp merged commit fdc3568 into openwebwork:PG-2.16 Apr 15, 2021
@drgrice1 drgrice1 deleted the mathjax-fix branch April 16, 2021 14:30
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.

4 participants