Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions testsuite/tests/input/tex/Amscd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,35 @@ describe('AmsCD', () => {

/********************************************************************************/

it('Spaces', () => {
toXmlMatch(
tex2mml('\\begin{CD}A @ > x > > B \\end{CD}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\begin{CD}A @ &gt; x &gt; &gt; B \\end{CD}" display="block">
<mtable columnspacing="5pt" rowspacing="5pt" displaystyle="true" data-latex-item="{CD}" data-latex="\\begin{CD}A @ &gt; x &gt; &gt; B \\end{CD}">
<mtr>
<mtd>
<mi data-latex="A">A</mi>
<mpadded height="8.5pt" depth="2pt"></mpadded>
</mtd>
<mtd>
<mover>
<mo minsize="2.75em">&#x2192;</mo>
<mpadded width="+.67em" lspace=".33em" voffset=".1em">
<mi data-latex="x">x</mi>
</mpadded>
</mover>
</mtd>
<mtd>
<mi data-latex="B">B</mi>
</mtd>
</mtr>
</mtable>
</math>`
);
});

/********************************************************************************/

it('Suspicious Return', () => {
toXmlMatch(
tex2mml('\\begin{CD}A @Ra>> BaD\\end{CD}'),
Expand Down
4 changes: 3 additions & 1 deletion ts/input/tex/amscd/AmsCdMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ const AmsCdMethods: { [key: string]: ParseMethod } = {
* @returns {void} No value.
*/
arrow(parser: TexParser, name: string): void {
const c = parser.string.charAt(parser.i);
const i = parser.i;
const c = parser.GetNext();
if (!c.match(/[><VA.|=]/)) {
// TODO: This return is suspicious.
parser.i = i;
return Other(parser, name);
} else {
parser.i++;
Expand Down