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 munderover elements that have been cleaned. (mathjax/MathJax#2691) #705

Merged
merged 2 commits into from
Jun 1, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented May 15, 2021

The ParseOptions.nodeLists object contains lists of elements generated during TeX input processing, and these are used by the post filters in order to do things like fix up munderover elements and combine mo relations. Sometimes this means an element is removed and another put in its place. When this happens, the element isn't currently being removed from its list, so later filters may try top process the removed element again. This happens with the cleanSubSup and moveLimits filters. If an munderover has been cleaned, it is still processed by moveLimits, sometimes leading to an error when the munderover has an empty child.

This PR adds a removeFromList() method to ParseOptions class that allows elements to be removed from its list. Because the for-of loop will miss an element if you modify the array from within the loop, we keep a list of nodes to remove and remove them all at the end.

Resolves isse mathjax/MathJax#2691.

@dpvc dpvc requested a review from zorkow May 15, 2021 13:54
@dpvc dpvc added this to the 3.2 milestone May 15, 2021
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.

lgtm.

@dpvc dpvc merged commit 11089f7 into develop Jun 1, 2021
@dpvc dpvc deleted the issue2691 branch June 1, 2021 12:51
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.

2 participants