mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
15 lines
330 B
JavaScript
15 lines
330 B
JavaScript
|
/* 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)
|