Skip to content

Fix magnification of HTML embedded in MathML or TeX.#1530

Open
dpvc wants to merge 1 commit into
developfrom
fix/html-magnification
Open

Fix magnification of HTML embedded in MathML or TeX.#1530
dpvc wants to merge 1 commit into
developfrom
fix/html-magnification

Conversation

@dpvc

@dpvc dpvc commented Jul 17, 2026

Copy link
Copy Markdown
Member

This PR fixes a problem with the keyboard or mouse magnification of expressions that include HTML embedded in the MathML or TeX expressions. The HTML was not being properly enlarged in the magnification window. This is due to the use of px font sizing in the CHTML output, and a pad interaction with the scaling in SVG output.

The solution for CHTML is to override the getFontStyles() method to use a scaling in em units (in this case, the parent elements already do the relative scaling, so 1em keeps it at that scale). For SVG, setting font-size to initial and leaving the px values seems to do the trick.

@dpvc
dpvc requested a review from zorkow July 17, 2026 13:45
@dpvc dpvc added this to the v4.2 milestone Jul 17, 2026
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.70%. Comparing base (9ef060f) to head (953b69b).

Files with missing lines Patch % Lines
ts/output/chtml/Wrappers/semantics.ts 55.55% 4 Missing ⚠️
ts/output/svg/Wrappers/semantics.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1530      +/-   ##
===========================================
- Coverage    86.70%   86.70%   -0.01%     
===========================================
  Files          340      340              
  Lines        86264    86273       +9     
  Branches      3246     4906    +1660     
===========================================
+ Hits         74798    74802       +4     
+ Misses       11466    11451      -15     
- Partials         0       20      +20     

☔ View full report in Codecov by Harness.
📢 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