overleaf/services/web/frontend/js/features/mathjax/index.js

15 lines
330 B
JavaScript
Raw Normal View History

/* global MathJax */
import { configureMathJax } from './configure'
import { mathJaxLoaded } from './util'
function render(el) {
if (!mathJaxLoaded()) return
configureMathJax()
setTimeout(() => {
MathJax.Hub.Queue(['Typeset', MathJax.Hub, el])
}, 0)
}
document.querySelectorAll('[data-ol-mathjax]').forEach(render)