Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 'single-character' mi's to include trailing combining characters (mathjax/MathJax#2617) #635

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Mar 17, 2021

This PR doesn't sound combining characters when counting the length of the content of an mi element in order to determine the mathvariant to use. This allows things like \not a to render as an italic "a" rather than an upright one.

Resolves issue mathjax/MathJax#2617.

@dpvc dpvc added this to the 3.1.3 milestone Mar 17, 2021
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

I note that you are making provisions for characters with combiners >1000.
I never got those to work. E.g., '\u0041\u0300'.normalize() works fine, however, '\u0041\u1ab0'.normalize() still gives me two characters. Am I doing something wrong?

@dpvc dpvc unassigned zorkow Mar 19, 2021
@dpvc
Copy link
Member Author

dpvc commented Mar 19, 2021

'\u0041\u0300'.normalize() works fine, however, '\u0041\u1ab0'.normalize() still gives me two characters. Am I doing something wrong?

No, that is what should happen. '\u0041\u0300'.normalize() gives you one character because there is a Unicode point U+00C0 for CAPITAL LETTER A WITH GRAVE, so the two can be combined into a single Unicode character. But U+1AB0 is the COMBINING DOUBLE CIRCUMFLEX ABOVE, but there is no single-character glyph for A with two circumflex accents, so this has to stay two characters. The point is that we want to count that as a single character, even though it is technically two, for the purposes of deciding whether it should be mathvariant="italic" or mathvariant="normal". The combining characters shouldn't make it count as two (causing it to become upright instead of italics), as it is semantically a single accented character, just like your first example.

@dpvc dpvc merged commit 866b904 into develop Mar 19, 2021
@dpvc dpvc deleted the issue2617 branch March 19, 2021 18:22
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