Merge pull request #4020 from overleaf/jpa-gracefully-access-mathjax

[frontend] chat: gracefully access MathJax details

GitOrigin-RevId: 5a68bf715a21c8b3881957afc7ac0ba83c353602
This commit is contained in:
Jakob Ackermann 2021-05-17 11:37:58 +02:00 committed by Copybot
parent 55f2a6e000
commit 2901de7830

View file

@ -10,7 +10,11 @@ function MessageContent({ content }) {
return
}
const MJHub = window.MathJax.Hub
const inlineMathConfig = MJHub.config && MJHub.config.tex2jax.inlineMath
const inlineMathConfig =
(MJHub.config &&
MJHub.config.tex2jax &&
MJHub.config.tex2jax.inlineMath) ||
[]
const alreadyConfigured = inlineMathConfig.some(
c => c[0] === '$' && c[1] === '$'
)