overleaf/services/web/frontend/js/directives/mathjax.js

16 lines
328 B
JavaScript
Raw Normal View History

/* global MathJax */
import App from '../base'
export default App.directive('mathjax', function ($compile, $parse) {
return {
link(scope, element, attrs) {
if (!(MathJax && MathJax.Hub)) return
setTimeout(() => {
MathJax.Hub.Queue(['Typeset', MathJax.Hub, element.get(0)])
}, 0)
},
}
})