From 04c5aec0723aae2d6742bafb5e20d39ba37ef130 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Tue, 22 Aug 2017 10:53:12 +0100 Subject: [PATCH] Catch errors from queueing Mathjax resetEquationNumbers call. --- notebook/static/base/js/utils.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/notebook/static/base/js/utils.js b/notebook/static/base/js/utils.js index c88a9fc9d..4e1c60532 100644 --- a/notebook/static/base/js/utils.js +++ b/notebook/static/base/js/utils.js @@ -940,12 +940,16 @@ define([ if(!window.MathJax){ return; } - return $el.map(function(){ + $el.map(function(){ // MathJax takes a DOM node: $.map makes `this` the context - return MathJax.Hub.Queue( - ["Typeset", MathJax.Hub, this], - ["resetEquationNumbers",MathJax.InputJax.TeX] - ); + MathJax.Hub.Queue(["Typeset", MathJax.Hub, this]); + try { + MathJax.Hub.Queue( + ["resetEquationNumbers", MathJax.InputJax.TeX] + ); + } catch (e) { + console.error("Error queueing resetEquationNumbers:", e); + } }); };