diff --git a/assets/javascripts/initializers/discourse-math-mathjax.js b/assets/javascripts/initializers/discourse-math-mathjax.js index a6be5ae..f0e96a4 100644 --- a/assets/javascripts/initializers/discourse-math-mathjax.js +++ b/assets/javascripts/initializers/discourse-math-mathjax.js @@ -116,14 +116,16 @@ function initializeMath(api, discourseMathOptions) { { id: "mathjax" } ); - api.decorateChatMessage( - (element) => { - mathjax(element, discourseMathOptions); - }, - { - id: "mathjax-chat", - } - ); + if (api.decorateChatMessage) { + api.decorateChatMessage( + (element) => { + mathjax(element, discourseMathOptions); + }, + { + id: "mathjax-chat", + } + ); + } } export default {