Skip to content

Commit

Permalink
Merge pull request #787 from mathjax/vcenter-fix
Browse files Browse the repository at this point in the history
Place super- and subscripts properly around \vcenter elements.
  • Loading branch information
dpvc authored Feb 22, 2022
2 parents 2051212 + 778220b commit 0411d10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ts/core/MmlTree/MmlNodes/mo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ export class MmlMo extends AbstractMmlTokenNode {
if (parent.isEmbellished) {
return (parent.coreMO() as MmlMo).getText();
}
while ((((parent.isKind('mrow') || parent.isKind('TeXAtom') || parent.isKind('mstyle') ||
while ((((parent.isKind('mrow') ||
(parent.isKind('TeXAtom') && parent.texClass !== TEXCLASS.VCENTER) ||
parent.isKind('mstyle') ||
parent.isKind('mphantom')) && parent.childNodes.length === 1) ||
parent.isKind('munderover')) && parent.childNodes[0]) {
parent = parent.childNodes[0] as MmlNode;
Expand Down
4 changes: 3 additions & 1 deletion ts/output/common/Wrappers/scriptbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import {AnyWrapper, WrapperConstructor, Constructor, AnyWrapperClass} from '../Wrapper.js';
import {CommonMo} from './mo.js';
import {CommonMunderover} from './munderover.js';
import {TEXCLASS} from '../../../core/MmlTree/MmlNode.js';
import {MmlMsubsup} from '../../../core/MmlTree/MmlNodes/msubsup.js';
import {MmlMo} from '../../../core/MmlTree/MmlNodes/mo.js';
import {BBox} from '../../../util/BBox.js';
Expand Down Expand Up @@ -368,7 +369,8 @@ export function CommonScriptbaseMixin<
let core = this.getSemanticBase() || this.childNodes[0];
while (core &&
((core.childNodes.length === 1 &&
(core.node.isKind('mrow') || core.node.isKind('TeXAtom') ||
(core.node.isKind('mrow') ||
(core.node.isKind('TeXAtom') && core.node.texClass !== TEXCLASS.VCENTER) ||
core.node.isKind('mstyle') || core.node.isKind('mpadded') ||
core.node.isKind('mphantom') || core.node.isKind('semantics'))) ||
(core.node.isKind('munderover') && core.isMathAccent))) {
Expand Down

0 comments on commit 0411d10

Please sign in to comment.