Make sure output renderer settings are transferred when the menu selects a new renderer.#1435
Merged
Make sure output renderer settings are transferred when the menu selects a new renderer.#1435
Conversation
…ts a new renderer.
Member
Author
|
Sorry to add this into the v4.1.1 milestone, but I came across this while trying to analyze mathjax/MathJax#3526. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1435 +/- ##
===========================================
- Coverage 86.51% 86.51% -0.01%
===========================================
Files 340 340
Lines 86031 86033 +2
Branches 4834 4834
===========================================
Hits 74430 74430
- Misses 11577 11603 +26
+ Partials 24 0 -24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes some problems with menu options not being applied to a new renderer when the menu is used to change the renderer. There were several issues.
A test case would be
Without this PR, if you change the "Wide Expressions" settings to "Linebreak" and uncheck "Allow in-line breaks", then change to the other output renderer, you should see that the menu settings still seem to be set, but the output isn't properly broken. Then reload the page and see that the settings still seem to be set, but not properly applied. Then reset the menu settings to their default values (including the renderer), and reload the page. Change the renderer and the wide-expression settings again, then change the renderer back to the default; the output will not have the proper breaking.
With this PR, when you make a change to the renderer and the wide expression settings and then either change the renderer back or reload the page, the output should remain broken in the same way.
The fix is to move the code that updates the output jax's options into a separate function, and then call that from
applySettings()where they originally were, and also call it in thesetRenderer()function to either update the existing output jax that you are moving to, or to update the new output jax when its code is loaded.