Skip to content

Fix isEmpty to work with partially complete msubsup elements with empty bases. (mathjax/MathJax#3532)#1439

Open
dpvc wants to merge 1 commit intodevelopfrom
issue3532
Open

Fix isEmpty to work with partially complete msubsup elements with empty bases. (mathjax/MathJax#3532)#1439
dpvc wants to merge 1 commit intodevelopfrom
issue3532

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Feb 27, 2026

This PR fixes an error with the isEmpty method introduced in v4.1.1. Because superscript and subscripts are handled using an msubsup node with null entries until we know whether it will have both scripts, in the case where the base is empty, isEmpty would fail when trying to test these null children. For, example {}^2 will generate an error. This PR fixes it by checking that the child is non-null before testing it.

It may be that this wants to be a 4.1.2 release, as this is not that unusual a construction, and it causes MathJax to crash.

Resolves issue mathjax/MathJax#3532.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.49%. Comparing base (5caee44) to head (11a46f0).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1439   +/-   ##
========================================
  Coverage    86.49%   86.49%           
========================================
  Files          340      340           
  Lines        86044    86044           
  Branches      4833     4833           
========================================
  Hits         74425    74425           
  Misses       11595    11595           
  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.

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