mathjax / MathJax-node

MathJax for Node
Apache License 2.0
616 stars 97 forks source link

Make sure SVG and HTML elements exist before using them. #441 #442

Open dpvc opened 5 years ago

dpvc commented 5 years ago

If the input jax fails to process the given input, the resulting SVG or HTML element for the output will not exist. So check that svg and html elements exist before trying to use them.

This resolves issue #441.

pkra commented 5 years ago

This looks ok to me.

But perhaps there should be some error or warning when an output is requested but cannot be fulfilled?

dpvc commented 5 years ago

When the SVG or HTML element is not generated, that means something went wrong in the input our output jax, and that should cause a Math Processing Error, which will already be in the error array. I can add an additional message, if you think that is a help, but there should already be an error there already. Let me know if you think an additional message is necessary and I'll modify the PR.