Skip to content

Commit 21f96b8

Browse files
authored
Merge pull request #1267 from mathjax/issue3372
Fix problem with overline with subscript with space after the underscore. (mathjax/MathJax#3372)
2 parents 36dd349 + 59d9840 commit 21f96b8

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

testsuite/tests/input/tex/Base.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4127,6 +4127,25 @@ describe('Moving limits', () => {
41274127

41284128
/********************************************************************************/
41294129

4130+
it('Subscripted overline with space (#3372)', () => {
4131+
toXmlMatch(
4132+
tex2mml('\\overline{X}_ {y}'),
4133+
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\overline{X}_ {y}" display="block">
4134+
<msub data-latex="\\overline{X}_ {y}">
4135+
<mover data-latex="\\overline{X}">
4136+
<mi data-latex="X">X</mi>
4137+
<mo accent="true">&#x2015;</mo>
4138+
</mover>
4139+
<mrow data-mjx-texclass="ORD">
4140+
<mi data-latex="y">y</mi>
4141+
</mrow>
4142+
</msub>
4143+
</math>`
4144+
);
4145+
});
4146+
4147+
/********************************************************************************/
4148+
41304149
it('Overbrace 1', () => {
41314150
toXmlMatch(
41324151
tex2mml('\\overbrace{abc}'),

ts/input/tex/TexParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ export default class TexParser {
733733
const children = atom.childNodes[0]?.childNodes || [];
734734
let expr = '';
735735
for (const child of children) {
736-
const att = (child.attributes?.get(TexConstant.Attr.LATEX) ||
736+
const att = (child?.attributes?.get(TexConstant.Attr.LATEX) ||
737737
'') as string;
738738
if (!att) continue;
739739
expr +=

0 commit comments

Comments
 (0)