Fixes handling of MathJax elements