Skip to content

Comments

Fix inline linebreaking issues with SVG output. (mathjax/MathJax#3526)#1436

Merged
dpvc merged 1 commit intodevelopfrom
fix/svg-inline-breaks
Feb 19, 2026
Merged

Fix inline linebreaking issues with SVG output. (mathjax/MathJax#3526)#1436
dpvc merged 1 commit intodevelopfrom
fix/svg-inline-breaks

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Feb 18, 2026

This PR fixes several issues with SVG output for inline expressions when automatic in-line breaks are enabled.

  • First, inline breaks were being forced even when they were not enabled. This is fixed by using the option setting in forceInlineBreaks in ts/output/svg.ts.
  • When switching from allowed breaks to breaks not being allowed, some embellished operators continued to be marked with the forcebreak property. This is fixed in ts/output/common.ts by removing the property that was added to the core mo in line 628.
  • Finally, the issue raised in SVG Renderer: Vertical misalignment of \rightleftarrows when used with \underset and \stackrel MathJax#3526 was due to the line break on the embellished operator being inserted in the wrong place. When the embellished operator had several embellished parents (i.e., the core is nested several layers deep), as in the nested \underset and \stackrel macros, the forced break was being made between these macros rather than before the first one. This is fixed in ts/output/svg/Wrapper.ts by checking that the parent element is not embellished before line breaking is performed for embellished operators.

Resolves issue mathjax/MathJax#3526.

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

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.50%. Comparing base (0b872a1) to head (0f3663e).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
ts/output/svg/Wrapper.ts 0.00% 7 Missing ⚠️
ts/output/svg.ts 0.00% 5 Missing ⚠️
ts/output/common.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1436      +/-   ##
===========================================
- Coverage    86.51%   86.50%   -0.02%     
===========================================
  Files          340      340              
  Lines        86031    86044      +13     
  Branches      4834     4834              
===========================================
  Hits         74430    74430              
- Misses       11577    11590      +13     
  Partials        24       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.

works. lgtm.

@dpvc dpvc merged commit 919caac into develop Feb 19, 2026
1 of 3 checks passed
@dpvc dpvc deleted the fix/svg-inline-breaks branch February 19, 2026 16:18
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