MathJax-src icon indicating copy to clipboard operation
MathJax-src copied to clipboard

make typesetPromise() wait for speech to be attached, add synchronous option, and copy ARIA labels to internal MathML

Open dpvc opened this issue 1 year ago • 1 comments

This PR implements the ideas we discussed in our meeting yesterday:

  • A new renderPromises array 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 that typesetPromise() will wait for it to complete.
  • A new asynchronous option is added to the speechTiming configuration object, initially set to true, that controls whether the speech is added synchronously or asynchronously. (When set to false, the speech is added during the renderAction processing 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()).

dpvc avatar Jun 28 '24 16:06 dpvc

When experimenting with this PR, I ran into a build error. Please see my email on it.

zorkow avatar Jul 02 '24 10:07 zorkow