Remove munderover elements that have been cleaned. (mathjax/MathJax#2691) #705
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.
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 upmunderover
elements and combinemo
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 thecleanSubSup
andmoveLimits
filters. If anmunderover
has been cleaned, it is still processed bymoveLimits
, sometimes leading to an error when themunderover
has an empty child.This PR adds a
removeFromList()
method toParseOptions
class that allows elements to be removed from its list. Because thefor-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.