Parse markdown correctly when mathjax is disabled

This should resolve #3835