From 2a0ee2e0f3679b04b2ed0d2f8f63cd41058071c5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 16 Jul 2025 11:33:06 -0400 Subject: [PATCH 1/2] Check that enrichment is enabled before starting webworker --- ts/a11y/speech.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ts/a11y/speech.ts b/ts/a11y/speech.ts index e7ceae9c2..2d3210df6 100644 --- a/ts/a11y/speech.ts +++ b/ts/a11y/speech.ts @@ -109,7 +109,8 @@ export function SpeechMathItemMixin< this.state(STATE.ATTACHSPEECH); if ( this.isEscaped || - !(document.options.enableSpeech || document.options.enableBraille) + !(document.options.enableSpeech || document.options.enableBraille) || + !document.options.enableEnrichment ) { return; } @@ -274,7 +275,8 @@ export function SpeechMathDocumentMixin< */ public attachSpeech(): SpeechMathDocument { if (!this.processed.isSet('attach-speech')) { - if (this.options.enableSpeech || this.options.enableBraille) { + const options = this.options; + if (options.enableEnrichment && (options.enableSpeech || options.enableBraille)) { this.getWebworker(); for (const math of this.math) { (math as SpeechMathItem).attachSpeech(this); From 2c15c6183e6678960a9d2716de82516a080d4454 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Thu, 17 Jul 2025 12:22:21 -0400 Subject: [PATCH 2/2] Fix formatting for prettier --- ts/a11y/speech.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/a11y/speech.ts b/ts/a11y/speech.ts index 2d3210df6..f20a41490 100644 --- a/ts/a11y/speech.ts +++ b/ts/a11y/speech.ts @@ -276,7 +276,10 @@ export function SpeechMathDocumentMixin< public attachSpeech(): SpeechMathDocument { if (!this.processed.isSet('attach-speech')) { const options = this.options; - if (options.enableEnrichment && (options.enableSpeech || options.enableBraille)) { + if ( + options.enableEnrichment && + (options.enableSpeech || options.enableBraille) + ) { this.getWebworker(); for (const math of this.math) { (math as SpeechMathItem).attachSpeech(this);