Skip to content

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Oct 2, 2025

This PR fixes a problem where margin CSS styles aren't properly handled by the Styles object. This is because margin wasn't set in the connections array, so setting margin didn't propagate to margin-left, etc. This means that when margin-left was set earlier and then margin is set to '' later, the margin-left setting is not cleared. That lead to extra margin settings in the example given in mathjax/MathJax#3443.

This PR adds the margin connections, and adds more tests for margins, and for overriding connections when the main property is set.

It also checks that the left and right margins aren't zero when setting them for shifting the output in the CHTML Wrapper object. This is just to keep the CSS minimal.

@dpvc dpvc requested a review from zorkow October 2, 2025 12:16
@dpvc dpvc added this to the v4.0.1 milestone Oct 2, 2025
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

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

Files with missing lines Patch % Lines
ts/output/chtml/Wrapper.ts 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1362      +/-   ##
===========================================
- Coverage    86.72%   86.71%   -0.01%     
===========================================
  Files          337      337              
  Lines        84145    84155      +10     
  Branches      3140     4769    +1629     
===========================================
+ Hits         72971    72977       +6     
- Misses       11174    11178       +4     

☔ 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