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

Fix problem with enabling explorer with MathML input. mathjax/MathJax#2255 #425

Merged
merged 3 commits into from
Jan 30, 2020

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jan 12, 2020

This PR fixes the issue with turning on/off the explorer when the input is MathML. This was caused by several issues. First, the reset() call in the renderActions list was causing the rerender() action initiated by the menu when explorer is toggled to try to reprocess the entire page (leading to duplicate entries in the math list). So the reset() has been moved to the MathJax.typeset() and MathJax.typesetPromise() calls. Users calling render() by hand will need to call reset() prior to that. (Since none of that is documented yet, it should not be an issue.) Also the menu code that creates a new document saves the processed bits as well (since they aren't being reset).

The other problem was that when the typeset content is removed in removeFromDocument(), it was being replaced by a blank text element, and the start.node pointer was set to that empty text element. But when MathML is compiled, the start.node pointer is supposed to be the MathML node itself. So this PR adds a check to see if start.node is a text node, and recompiled from the original MathML text instead.

Resolves issue mathjax/MathJax#2255.

…or rerender(). Save processed when menu creates a new document, and dont' actually recompile on rerender (we just need enrichment, etc.). Resolves issue mathjax/MathJax#2255.
@dpvc dpvc requested a review from zorkow January 12, 2020 00:03
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

Works fine.

@dpvc dpvc merged commit 85b2857 into develop Jan 30, 2020
@dpvc dpvc deleted the issue2255 branch January 30, 2020 17:57
@dpvc dpvc added this to the 3.0.1 milestone Mar 5, 2020
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.

None yet

2 participants