From f683a5d654178be3b444d8a55b956aa0fa70dd8e Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Fri, 15 Sep 2023 14:22:22 +0200 Subject: [PATCH] Fixes uncaught type error Math support will only be provided if the user has checked the corresponding box in plugin settings. When no math support is required the javascript snippet should be ignored. Since only MathJax will be ignored and not MathJax.Hub, javascript will raise a type error. This is fixed with a further condition. --- assets/javascripts/drawioEditor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/javascripts/drawioEditor.js b/assets/javascripts/drawioEditor.js index 526220b7..f2a643af 100644 --- a/assets/javascripts/drawioEditor.js +++ b/assets/javascripts/drawioEditor.js @@ -586,7 +586,9 @@ window.onDrawioViewerLoad = function() { GraphViewer.processElements(); // Make sure MathJax sees the SVG generated by te viewer if(typeof(MathJax) !== 'undefined') { + if (typeof(MathJax.Hub) !== 'undefined') { MathJax.Hub.Queue(["Typeset",MathJax.Hub]); + } } }