New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AssistiveMML support to v3 #410
Conversation
…and use that for the assistive MathML extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos. One crucial.
Also I can't webpack a11y/assistive-mml
. I investigated, but it is nothing obvious (e.g., capitalisation).
OK, the webpack was probably my fault for not explicitly typescripting before building. |
Indeed.
That string is used to tell MathJax that |
OK, I've made the update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
This PR implements an assistive-mml extension that corresponds to the version 2 AssistiveMML extension. It is implemented as an a11y extension similar to how
semantic-enrich
and the other ones operate (via extensions to the MathDocument and MathItem classes to add methods for creating the hidden MathML). Because the extension needed to be able to generate CSS styles to hide the MathML, this required extending the HTMLDocument class to allow extensions to add CSS to the document.This also adds a menu item to to the accessibility menu to control whether assistive MathML is inserted into the page or not (default is yes), so that those who don't need it will be able to turn it off for faster rendering.
It would probably be a good idea to move the output/common/CssStyles.ts file to utilities at some point, but I didn't do that here since it touches a number of files.
Resolves issue mathjax/MathJax#2260