mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
18 lines
553 B
TypeScript
18 lines
553 B
TypeScript
|
import { loadMathJax } from '@/features/mathjax/load-mathjax'
|
||
|
import { debugConsole } from '@/utils/debugging'
|
||
|
import getMeta from '@/utils/meta'
|
||
|
|
||
|
window.addEventListener('DOMContentLoaded', function () {
|
||
|
const elements = document.querySelectorAll('[data-ol-mathjax]')
|
||
|
if (elements.length > 0) {
|
||
|
loadMathJax({
|
||
|
enableMenu: true,
|
||
|
numbering: 'ams',
|
||
|
singleDollar: !getMeta('ol-no-single-dollar'),
|
||
|
useLabelIds: true,
|
||
|
})
|
||
|
.then(MathJax => MathJax.typesetPromise([...elements]))
|
||
|
.catch(debugConsole.error)
|
||
|
}
|
||
|
})
|