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 incorrect flagging of nested environments. (mathjax/MathJax#3070) #975

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jul 20, 2023

This PR fixes an incorrect error message about nested environments whenever the equation, displaymath, or math environments are used. There were two calls to parser.Push(begin) in

BaseMethods.Equation = function (
parser: TexParser,
begin: StackItem,
numbered: boolean,
display: boolean = true
) {
parser.configuration.mathItem.display = display;
parser.stack.env.display = display;
parser.Push(begin);
ParseUtil.checkEqnEnv(parser);
parser.Push(begin);
return parser.itemFactory.create('equation', numbered).
setProperty('name', begin.getName());
};

but the first was supposed to have been removed:

7bb5fbd#diff-8b54d4a07ba56e1e6678245687ace65d468dd87cb4c8770a11b261c94d0231a0

Not sure how it got restored (maybe a bad merge or merge conflict resolution). In any case, the first one needs to be removed, as it forces the "Erroneous nesting" message to be produced whenever \begin{equation}...\end{equation} is used (and also affects the displaymath and math environments).

Resolve issue mathjax/MathJax#3070.

@dpvc dpvc requested a review from zorkow July 20, 2023 14:56
@dpvc dpvc added this to the v4.0 milestone Aug 15, 2023
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 a662fa7 into develop Aug 18, 2023
@dpvc dpvc deleted the issue3070 branch August 18, 2023 15:24
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