Fix CSS for zero-width combining characters so it doesn't impact other variants.#1445
Open
Fix CSS for zero-width combining characters so it doesn't impact other variants.#1445
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1445 +/- ##
===========================================
- Coverage 86.49% 86.49% -0.01%
===========================================
Files 340 340
Lines 86044 86050 +6
Branches 4833 3190 -1643
===========================================
Hits 74425 74425
- Misses 11595 11625 +30
+ Partials 24 0 -24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some fonts, the combining characters are zero-width (so that they overlap the character on the left). Others are normal width, and the browser positions the character automatically, at least win some browsers (not Safari). MathJax has to accommodate both types of characters, and browsers that do and do not handle the normal width characters themselves. It does this by setting
widthCSS for the zero-width characters so that they have the actual width of the ink of the character andmargin-leftto position it so it extends to the left. This gives the character an actual width, but still places it as usual when not used as an accent. But if there are other sizes of the character that are not zero-width, they will inherit themargin-leftfrom the normal size, and so get placed incorrectly.This happens with U+0332 (combining underline) in the
mathjax-newcmfont. For example, the expressioncurrently produces output where the first underline is shifted to the left:
This is because the CSS for the normal size (used under the "t") has
margin-left, while the first one (in a larger size) does not, but inherits the margin-left from the normal size when it shouldn't.The solution used here is to isolate the normal size's CSS to not apply to other variants when it has
margin-leftset. That is done by adding a:not()portion to the selector that rules out versions taken from other variants.