File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/packages/frontend/jupyter/output-messages Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -66,15 +66,17 @@ export function IpyWidget({ value, actions }: WidgetProps) {
66
66
// HACK: because upstream ipywidgets only checks for MathJax.Hub to be defined then
67
67
// crashes on load -- they don't see this bug because user has to explicitly re-evaluate
68
68
// code to see anything on page refresh, due to all state being on the frontend.
69
+ // @ts -ignore
69
70
if ( window . MathJax != null && window . MathJax . Hub == null ) {
71
+ // @ts -ignore
70
72
MathJax . Hub . Queue = ( ) => { } ;
71
73
}
72
74
setTimeout ( ( ) => {
73
75
// Run mathjax on labels: widgets.HBox([widgets.Label(value="The $m$ in $E=mc^2$:"), widgets.FloatSlider()])
74
76
// @ts -ignore
75
- $ ( divRef . current ) . find ( ".widget-label" ) . katex ( { preProcess : true } ) ;
77
+ $ ( divRef . current ) . find ( ".widget-label" ) . katex ?. ( { preProcess : true } ) ;
76
78
// @ts -ignore
77
- $ ( divRef . current ) . find ( ".widget-htmlmath" ) . katex ( { preProcess : true } ) ;
79
+ $ ( divRef . current ) . find ( ".widget-htmlmath" ) . katex ?. ( { preProcess : true } ) ;
78
80
} , 0 ) ;
79
81
} catch ( err ) {
80
82
console . warn ( err ) ;
You can’t perform that action at this time.
0 commit comments