Upgrade to MathJax v4 (#15030)

GitOrigin-RevId: d1536bce67286da23e15aa18eb525dd83859978b
This commit is contained in:
Alf Eaton
2026-06-03 08:05:55 +00:00
committed by Copybot
parent b6451d5bb0
commit 979f065581
9 changed files with 64 additions and 46 deletions
@@ -25,14 +25,17 @@ export class MathWidget extends WidgetType {
view.dispatch(placeSelectionInsideBlock(view, event as MouseEvent))
})
}
this.renderMath(element)
.catch(() => {
element.classList.add('ol-cm-math-error')
})
.finally(() => {
view.requestMeasure()
})
// in a timeout so the element can be rendered for metrics
window.setTimeout(() => {
this.renderMath(element)
.catch(() => {
element.classList.add('ol-cm-math-error')
})
.finally(() => {
view.requestMeasure()
})
})
// TODO: re-render on element resize
return element
}