index.js 330 B

1234567891011121314
  1. /* global MathJax */
  2. import { configureMathJax } from './configure'
  3. import { mathJaxLoaded } from './util'
  4. function render(el) {
  5. if (!mathJaxLoaded()) return
  6. configureMathJax()
  7. setTimeout(() => {
  8. MathJax.Hub.Queue(['Typeset', MathJax.Hub, el])
  9. }, 0)
  10. }
  11. document.querySelectorAll('[data-ol-mathjax]').forEach(render)