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

[Math Processing Error] with mathvariant #363

Closed
fred-wang opened this issue Dec 19, 2012 · 5 comments
Closed

[Math Processing Error] with mathvariant #363

fred-wang opened this issue Dec 19, 2012 · 5 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Available v2.2

Comments

@fred-wang
Copy link
Contributor

The mathvariant attribute values for arabic scripts as well as unknow values can cause a [Math Processing Error].

The MathJax testsuite contains tests here:

MathMLToDisplay/Characters/Variants/

They are taken from the MathML test suite, but don't test the attributes mentioned above. Here is a testcase:

<math><mi mathvariant="inital">x</mi></math>
<math><mi mathvariant="tailed">x</mi></math>
<math><mi mathvariant="looped">x</mi></math>
<math><mi mathvariant="stretched">x</mi></math>
<math><mi mathvariant="unknown">x</mi></math>
@fred-wang
Copy link
Contributor Author

The error is:

"variant is undefined"
file "http://cdn.mathjax.org/mathjax/latest/unpacked/jax/output/HTML-CSS/jax.js"
line 1877

@fred-wang
Copy link
Contributor Author

HTMLgetVariant (and SVGgetVariant) does not seem to do anything to handle the arabic scripts or invalid mathvariants. I guess the error happens when the function arrives at return HTMLCSS.FONTDATA.VARIANT[variant] where the entry is undefined. Would it make sense to verify at the beginning of the function whether the mathvariant attribute value is valid and to fallback values.mathvariant to "normal" otherwise?

@fred-wang
Copy link
Contributor Author

Crashtests/issue363.html

=> In testsuite

@fred-wang
Copy link
Contributor Author

I just pushed a fix for this in my issue363 branch. I also added more tests to the test suite.

dpvc added a commit to dpvc/MathJax that referenced this issue Mar 20, 2013
@dpvc
Copy link
Member

dpvc commented Mar 20, 2013

I've merged your issue363 branch into develop.

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 Available v2.2
Projects
None yet
Development

No branches or pull requests

2 participants