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

Unexpected text node: '2', can't use annotation tags #29

Open
henok-tesfaye opened this issue Nov 25, 2019 · 4 comments
Open

Unexpected text node: '2', can't use annotation tags #29

henok-tesfaye opened this issue Nov 25, 2019 · 4 comments

Comments

@henok-tesfaye
Copy link

henok-tesfaye commented Nov 25, 2019

<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn><mo>=</mo><semantics><mrow><mn>2</mn></mrow><annotation encoding="text/plain">2</annotation></semantics><mspace linebreak="newline"/><mn>2</mn><mo>=</mo><semantics><mrow><mn>3</mn></mrow><annotation encoding="text/plain">3</annotation></semantics></math>

I tried this math formula here, https://focused-tesla-b6fe0a.netlify.com/, and It shows Unexpected text node: '2'.
But when I delete all the annotation tags it works?

@mehdisadeghi
Copy link
Owner

mehdisadeghi commented Dec 1, 2019

Thanks for reporting this. This is a configuration problem in this code. Configuring MathJax in React is not straightforward and I didn't find a quick fix for that. I will try to address this issue when updating to MathJax 3. Meanwhile feel free to submit a PR if you have a solution.

@udit-compro
Copy link
Contributor

What is the expected output?
The above mentioned link is not working.

@mehdisadeghi
Copy link
Owner

@udit-compro the new demo page is here: https://mehdisadeghi.github.io/react-mathjax-preview/. Just try the mathml mentioned above there. Apparently the given matml produces an error.

@udit-compro
Copy link
Contributor

@mehdisadeghi Thanks. I will see if I am able to fix this. The issue is because of DOMPurify that's all I know as of now. We might need to pass some sanitizationConfig which will fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants