Skip to content

Prevent webpacking from producing invalid names for region stylesheets - #1565

Open
dpvc wants to merge 1 commit into
developfrom
fix/region-css
Open

Prevent webpacking from producing invalid names for region stylesheets#1565
dpvc wants to merge 1 commit into
developfrom
fix/region-css

Conversation

@dpvc

@dpvc dpvc commented Sep 10, 2026

Copy link
Copy Markdown
Member

This PR fixes a problem with the id attribute for the style-sheets used for the various Region classes. It currently is based on the class's name property, which should be the class name, but when webpacked the name can be changes to some random characters, and it is possible for that to produce an invalid element id. E.g., I had one of the region classes be named $E, and that lead to an error in the browser for MJX-$E-styles being used as the id attribute.

The solution used here is to use the className property rather than name, since that is something like MJX_hover and won't be changed by webpack.

@dpvc
dpvc requested a review from zorkow September 10, 2026 17:57
@dpvc dpvc added this to the v4.2 milestone Sep 10, 2026
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.12%. Comparing base (91b8038) to head (59bdc3d).

Additional details and impacted files
@@            Coverage Diff             @@
##           develop    #1565     +/-   ##
==========================================
  Coverage    87.12%   87.12%             
==========================================
  Files          392      392             
  Lines        89187    89187             
  Branches      5063     3370   -1693     
==========================================
  Hits         77706    77706             
  Misses       11481    11481             

☔ 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