Search code examples
vue.jsdommathml

Vue js Load xmlns schema after updating DOM


I am dynamically updating the dom with vue js, but i discovered that my math tag is not being loaded after vue updates the dom. for example, this code

<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<p>
  <math xmlns="http://www.w3.org/1998/Math/MathML">
    <msqrt>
      <mi>x</mi>
      <mi>y</mi>
    </msqrt>
  </math>
</p>

is supposed to display the square root of xy. If i copy this code and paste it in a clean html file, it works well, but if it is rendered by vue, the math tag gets rendered as normal text. Is there a way to force vue to load the xmlns schema of the math object before updating the dom with it?


Solution

  • I later discovered that this was a compatibility issue with browsers. Some browsers do not render math tags