Skip to content

Commit 96ce9ae

Browse files
committed
Don't alter the typeset option lists in case they are reused
1 parent 4d1e195 commit 96ce9ae

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

ts/components/startup.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,11 @@ export abstract class Startup {
457457
) {
458458
const name = iname + '2' + oname;
459459
MathJax[name] = (math: string, options: OptionList = {}) => {
460-
options.format = input.name;
460+
options = { ...options, format: input.name };
461461
return Startup.document.convert(math, options);
462462
};
463463
MathJax[name + 'Promise'] = (math: string, options: OptionList = {}) => {
464-
options.format = input.name;
464+
options = { ...options, format: input.name };
465465
return Startup.document.convertPromise(math, options);
466466
};
467467
MathJax[oname + 'Stylesheet'] = () =>
@@ -487,16 +487,14 @@ export abstract class Startup {
487487
public static makeMmlMethods(name: string, input: INPUTJAX) {
488488
const STATE = MathJax._.core.MathItem.STATE;
489489
MathJax[name + '2mml'] = (math: string, options: OptionList = {}) => {
490-
options.end = STATE.CONVERT;
491-
options.format = input.name;
490+
options = { ...options, end: STATE.CONVERT, format: input.name };
492491
return Startup.toMML(Startup.document.convert(math, options));
493492
};
494493
MathJax[name + '2mmlPromise'] = async (
495494
math: string,
496495
options: OptionList = {}
497496
) => {
498-
options.end = STATE.CONVERT;
499-
options.format = input.name;
497+
options = { ...options, end: STATE.CONVERT, format: input.name };
500498
const node = await Startup.document.convertPromise(math, options);
501499
return Startup.toMML(node);
502500
};

0 commit comments

Comments
 (0)