Skip to content

Commit 7c43778

Browse files
committed
Make mml3 extension only add to MathML prefilters once.
1 parent f680979 commit 7c43778

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ts/input/mathml/mml3/mml3.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,11 @@ export function Mml3Handler<N, T, D>(handler: Handler<N, T, D>): Handler<N, T, D
104104
if (options.InputJax) {
105105
for (const jax of options.InputJax) {
106106
if (jax.name === 'MathML') {
107-
const mml3 = new Mml3(this);
108-
jax.preFilters.add(mml3.preFilter.bind(mml3));
107+
if (!jax.options._mml3) { // prevent filter being added twice (e.g., when a11y tools load)
108+
const mml3 = new Mml3(this);
109+
jax.preFilters.add(mml3.preFilter.bind(mml3));
110+
jax.options._mml3 = true;
111+
}
109112
break;
110113
}
111114
}

0 commit comments

Comments
 (0)