Skip to content

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

Merged
dpvc merged 2 commits into
developfrom
fix/html-magnification
Aug 8, 2026
Merged

Fix magnification of HTML embedded in MathML or TeX.#1530
dpvc merged 2 commits 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 72.72727% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.92%. Comparing base (9ef060f) to head (20c3d72).
⚠️ Report is 142 commits behind head on develop.

Files with missing lines Patch % Lines
ts/output/chtml/Wrappers/semantics.ts 80.00% 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.92%   +0.22%     
===========================================
  Files          340      390      +50     
  Lines        86264    87853    +1589     
  Branches      3246     4984    +1738     
===========================================
+ Hits         74798    76370    +1572     
+ Misses       11466    11464       -2     
- Partials         0       19      +19     

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

@zorkow zorkow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing jsdoc. Otherwise fine.

Comment thread ts/output/chtml/Wrappers/semantics.ts Outdated
Comment thread ts/output/chtml/Wrappers/semantics.ts Outdated
@dpvc
dpvc merged commit 6c2be35 into develop Aug 8, 2026
1 check passed
@dpvc
dpvc deleted the fix/html-magnification branch August 8, 2026 17:54
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