Skip to content
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

Fix menu to not rerender if no typesetting has occurred. (mathjax/MathJax#3167) #1044

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jan 27, 2024

If the MathJax configuration includes startup {typeset: false} and also has menu settings that require loading extensions (e.g., if assistive-mml is on) or the user has set the menu so that something needs to be loaded (e.g., the renderer has been changed in the contextual menu), then the math will be typeset despite the typeset: false setting (because the Menu code will think a pre-render is necessary because of the menu settings).

This PR adds a rerenderPromise to the ts/components/startup.ts file that is initially null (meaning no typesetting has occurred), and is set to the MathJax.startup.promise once typesetting has been requested. That lets the menu code determine if a re-render is needed (i.e., typesetting has already occurred), and gives it a promise to use to queue its rerender action so as to synchronize with other typesetting actions.

Resolves issue mathjax/MathJax#3167.

@dpvc dpvc requested a review from zorkow January 27, 2024 22:25
@dpvc dpvc added this to the v4.0 milestone Jan 27, 2024
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

lgtm.

@dpvc dpvc merged commit c48f82c into develop Feb 1, 2024
@dpvc dpvc deleted the issue3167a branch February 1, 2024 13:02
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.

2 participants