Skip to content

Commit abf2652

Browse files
committed
Fix handling of argument to \set and others. (mathjax/MathJax#3447)
1 parent 59a9b65 commit abf2652

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

ts/input/tex/braket/BraketMethods.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ import { ParseMethod, ParseResult } from '../Types.js';
2525
import BaseMethods from '../base/BaseMethods.js';
2626
import TexParser from '../TexParser.js';
2727
import { TEXCLASS } from '../../../core/MmlTree/MmlNode.js';
28-
import TexError from '../TexError.js';
2928
import { BraketItem } from './BraketItems.js';
3029

3130
const BraketMethods: { [key: string]: ParseMethod } = {
3231
/**
3332
* Generate a bra-ket expression.
3433
*
3534
* @param {TexParser} parser The current TeX parser.
36-
* @param {string} _name Name of the current control sequence.
35+
* @param {string} name Name of the current control sequence.
3736
* @param {string} open Opening delimiter.
3837
* @param {string} close Closing delimiter.
3938
* @param {boolean} stretchy Is it stretchy.
@@ -42,21 +41,17 @@ const BraketMethods: { [key: string]: ParseMethod } = {
4241
*/
4342
Braket(
4443
parser: TexParser,
45-
_name: string,
44+
name: string,
4645
open: string,
4746
close: string,
4847
stretchy: boolean,
4948
barmax: number,
5049
space: boolean = false
5150
) {
51+
const i = parser.i;
52+
parser.GetArgument(name); // Error if there isn't a proper argument
53+
parser.i = i;
5254
const next = parser.GetNext();
53-
if (next === '') {
54-
throw new TexError(
55-
'MissingArgFor',
56-
'Missing argument for %1',
57-
parser.currentCS
58-
);
59-
}
6055
let single = true;
6156
if (next === '{') {
6257
parser.i++;

0 commit comments

Comments
 (0)