Skip to content

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Sep 15, 2025

This PR fixes a problem where the column width for a column with stretchy characters isn't adjusted if the stretched version of the character is wider than the expected stretch width. This can happen if a fixed-size character is used that is slightly larger than needed (which is allowed), or if the stretchy has a minsize attribute that makes it larger than expected. The latter is true in the case cited in mathjax/MathJax#3423.

We fix the problem by making sure we always stretch characters, even if there is only one stretchy (so as to handle midsize even on a single row), and testing if the new width is wider than the column width, and adjusting that width if so. We also remove a variable that is no longer needed.

A test case is

\begin{CD}
A @= B
\end{CD}

Without this patch the equal sign overlaps the A and B.

Resolves issue mathjax/MathJax#3423.

@dpvc dpvc requested a review from zorkow September 15, 2025 10:47
@dpvc dpvc added this to the v4.0.1 milestone Sep 15, 2025
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.71%. Comparing base (afaf1ea) to head (2bde9c8).

Files with missing lines Patch % Lines
ts/output/common/Wrappers/mtable.ts 14.28% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1353      +/-   ##
===========================================
- Coverage    86.72%   86.71%   -0.01%     
===========================================
  Files          337      337              
  Lines        84145    84149       +4     
  Branches      3140     3140              
===========================================
- Hits         72971    72970       -1     
- Misses       11174    11179       +5     

☔ 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.

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.

1 participant