Skip to content

Commit

Permalink
Merge pull request #1034 from mathjax/fix-bits
Browse files Browse the repository at this point in the history
Clear process bits for findMath and attach-speech, and remove safe bit that isn't needed.
  • Loading branch information
dpvc authored Dec 28, 2023
2 parents 13016ac + 843612b commit 0be2b55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ts/a11y/semantic-enrich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ export function EnrichedMathDocumentMixin<N, T, D, B extends MathDocumentConstru
if (state < STATE.ENRICHED) {
this.processed.clear('enriched');
}
if (state < STATE.ATTACHSPEECH) {
this.processed.clear('attach-speech');
}
return this;
}

Expand Down
3 changes: 3 additions & 0 deletions ts/core/MathDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,9 @@ export abstract class AbstractMathDocument<N, T, D> implements MathDocument<N, T
if (state < STATE.COMPILED) {
this.processed.clear('compile');
}
if (state < STATE.FINDMATH) {
this.processed.clear('findMath');
}
return this;
}

Expand Down
4 changes: 0 additions & 4 deletions ts/ui/safe/SafeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ export function SafeMathDocumentMixin<N, T, D, B extends MathDocumentConstructor
constructor(...args: any[]) {
super(...args);
this.safe = new this.options.SafeClass(this, this.options.safeOptions);
const ProcessBits = (this.constructor as typeof BaseDocument).ProcessBits;
if (!ProcessBits.has('safe')) {
ProcessBits.allocate('safe');
}
for (const jax of this.inputJax) {
if (jax.name.match(/MathML/)) {
(jax as any).mathml.filterAttribute = this.safe.mmlAttribute.bind(this.safe);
Expand Down

0 comments on commit 0be2b55

Please sign in to comment.