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

v3 fails to handle equal sign in Unicode. #2309

Closed
w32zhong opened this issue Jan 26, 2020 · 1 comment
Closed

v3 fails to handle equal sign in Unicode. #2309

w32zhong opened this issue Jan 26, 2020 · 1 comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3.0

Comments

@w32zhong
Copy link

w32zhong commented Jan 26, 2020

MathJax v3 demo page has issue rendering this formula containing an Unicode equal sign:

$\sum_{k=1}$

The error message is

Cannot read property 'parentNode' of null

I am not sure if the demo page is using some outdated version or does this issue still exist in latest version.

@dpvc
Copy link
Member

dpvc commented Jan 26, 2020

The issue stems from the fact that your equal sign is form the full-width character range, and the MathJax fonts don't include that character. That means MathJax needs to try to measure the character in the browser, since it has no metric information for it. The demonstration you link to is an illustration of the MathJax.tex2chtml() function, which calls the convert() function internally. That converts a TeX string to DOM elements without the need for the string to be in the document itself. But when MathJax needs to measure unknown characters, it must insert it into the document to do so. MathJax inserts the character in the document at the location of the original math string, but in the case of convert(), there is no such location, and that is what is leading to this error.

I have made a pull request that allows convert() to handle unknown characters without throwing an error.

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team Ready for Review Test Needed labels Jan 26, 2020
dpvc added a commit to mathjax/MathJax-src that referenced this issue Jan 30, 2020
Make convert() handle unknown characters.   mathjax/MathJax#2309
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Jan 30, 2020
@dpvc dpvc added this to the MathJax v3.0.1 milestone Feb 5, 2020
@dpvc dpvc added Fixed v3.0 and removed Merged Merged into develop branch labels Feb 10, 2020
@dpvc dpvc closed this as completed Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3.0
Projects
None yet
Development

No branches or pull requests

2 participants