Skip to content

Commit

Permalink
Merge pull request #415 from mathjax/issue2261
Browse files Browse the repository at this point in the history
Make TexParser.Push() handle inferred mrows properly. mathjax/MathJax#2261
  • Loading branch information
dpvc committed Jan 23, 2020
2 parents 7fe484b + 8c38210 commit 1c795b8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ts/input/tex/TexParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {Tags} from './Tags.js';
import TexError from './TexError.js';
import {AbstractSymbolMap, SymbolMap} from './SymbolMap.js';
import {MmlMo} from '../../core/MmlTree/MmlNodes/mo.js';
import {MmlNode} from '../../core/MmlTree/MmlNode.js';
import {MmlNode, AbstractMmlNode} from '../../core/MmlTree/MmlNode.js';
import {ParseInput, ParseResult, ParseMethod} from './Types.js';
import ParseOptions from './ParseOptions.js';
import {StackItem, EnvList} from './StackItem.js';
Expand Down Expand Up @@ -194,11 +194,16 @@ export default class TexParser {


/**
* Pushes a new item onto the stack. The item can also be a Mml node.
* Pushes a new item onto the stack. The item can also be a Mml node,
* but if the mml item is an inferred row, push its children instead.
* @param {StackItem|MmlNode} arg The new item.
*/
public Push(arg: StackItem|MmlNode) {
this.stack.Push(arg);
if (arg instanceof AbstractMmlNode && arg.isInferred) {
this.PushAll(arg.childNodes);
} else {
this.stack.Push(arg);
}
}


Expand Down

0 comments on commit 1c795b8

Please sign in to comment.