MathJax-src
MathJax-src copied to clipboard
make typesetPromise() wait for speech to be attached, add synchronous option, and copy ARIA labels to internal MathML
This PR implements the ideas we discussed in our meeting yesterday:
- A new
renderPromisesarray is added to the MathDocument that holds promises that are created by the render actions. - The
typesetPromise()function now waits for those promises to resolve before its own promise resolves. - The
attachSpeech()action now creates a promise that resolves when the speech loop completes so thattypesetPromise()will wait for it to complete. - A new
asynchronousoption is added to thespeechTimingconfiguration object, initially set totrue, that controls whether the speech is added synchronously or asynchronously. (When set tofalse, the speech is added during therenderActionprocessing directly, which will be useful for node-based page preprocessing.)
In addition, a bug with the defaultPageReady() call is fixed, so that it will resolve the initial typesetting promise. That way, if a user provides a pageReady() configuration function, it can call the promise-based converters, which now wait on that promise before they run. That was causing a catch-22 where the pageReady() call never completed because the initial typeset promise was being resolved only in the ready() function (which calls pageReady()).
When experimenting with this PR, I ran into a build error. Please see my email on it.