Skip to content

Make sure output renderer settings are transferred when the menu selects a new renderer.#1435

Merged
dpvc merged 1 commit intodevelopfrom
fix/sticky-output-options
Feb 19, 2026
Merged

Make sure output renderer settings are transferred when the menu selects a new renderer.#1435
dpvc merged 1 commit intodevelopfrom
fix/sticky-output-options

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Feb 18, 2026

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.

  • If you select a new renderer, then change render settings (like the "wide expression" settings), then switch back to the original renderer, the settings show as changed in the menu, but the settings of the original output jax are still in effect.
  • If you select a new renderer and change the render settings, then reload the page, the menu shows the new settings, but the default settings are in use for the new renderer.

A test case would be

<div style="width: 15em; border: 1px solid black">
\(x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\)
\[x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\]
</div>

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 the setRenderer() 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.

@dpvc dpvc requested a review from zorkow February 18, 2026 19:36
@dpvc dpvc added this to the v4.1.1 milestone Feb 18, 2026
@dpvc
Copy link
Member Author

dpvc commented Feb 18, 2026

Sorry to add this into the v4.1.1 milestone, but I came across this while trying to analyze mathjax/MathJax#3526.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.51%. Comparing base (0b872a1) to head (d6eaf52).
⚠️ Report is 6 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 d634530 into develop Feb 19, 2026
3 checks passed
@dpvc dpvc deleted the fix/sticky-output-options branch February 19, 2026 16:20
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