Skip to content

Use the ui/safe data URL filter for the values used in \data TeX macros - #1561

Open
dpvc wants to merge 1 commit into
developfrom
fix/data-filter
Open

Use the ui/safe data URL filter for the values used in \data TeX macros#1561
dpvc wants to merge 1 commit into
developfrom
fix/data-filter

Conversation

@dpvc

@dpvc dpvc commented Sep 2, 2026

Copy link
Copy Markdown
Member

This PR causes the \data macro in TeX to use the ui/safe data filter when the safe extension is loaded. This prevents the \data macro from entering data attributes that could be harmful within frameworks that use data attributes for code control.

It also removes a reference that looks up a data-MJX attribute that is never actually set anywhere in the code.

In addition, it cleans up the mechanism used to set the MathML attribute and class filters by adding a service method to the MathML and MathMLCompile objects to set those values rather that casting the jax to any and setting them by hand.

Finally, it corrects an incorrect type that appears in the jsDoc for one of the safe methods.

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

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.12%. Comparing base (106e5ac) to head (ec04842).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1561   +/-   ##
========================================
  Coverage    87.12%   87.12%           
========================================
  Files          392      392           
  Lines        89098    89102    +4     
  Branches      5046     5048    +2     
========================================
+ Hits         77628    77632    +4     
  Misses       11450    11450           
  Partials        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