Skip to content

Conversation

@TylerZeroMaster
Copy link
Contributor

https://openstax.atlassian.net/browse/CORE-1294

Update to MathJax 4 in order to fix speech generation. There's one workaround for dealing with empty mtr. Also, I removed html output since we are not using that. It shouldn't be too hard to add it back, but it didn't seem worth it right now.

There are some visual differences since the font is slightly different, but I tried to keep it as close to the old as possible. I was able to configure the min script size in the ready section of the config instead of using an extension.

The missing font variants part I am less sure about. I have some idea how to replicate that in MathJax 4 using fontparams, but I am not sure if that's still required.

@TylerZeroMaster
Copy link
Contributor Author

I created an issue for the empty mtr problem here. I think the workaround is fine for production. It's just a little annoying that we will have some extra non-fatal errors in the logs.

This works for tagged pdfs, the other doesn't. Browsers also recognize title as a valid alternate description + add a tooltip.
So far, this only happens when a math element only contains mspace and nothing else.
Event emitter had some problems with serializing the DOM.
Copy link
Member

@Dantemss Dantemss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It made sense to me while I was reading the code, but there are a lot of changes here. It would also be good to have someone in the content team (Theresa?) take a look at the font changes you mentioned and approve everything.

log.debug(`There are ${total} elements to process...`)
const convertMathML = async (log, mathEntries, outputFormat, batchSize, handleErrors) => {
log.debug(`There are ${mathEntries.length} elements to process...`)
log.debug('Starting conversion of mapped MathML elements with mathjax-node...')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess technically you removed mathjax-node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants