Remove MathJax v2 (#16961)

GitOrigin-RevId: 32a43361cfc883aa1a5ed85f6be5432b6e838b9d
This commit is contained in:
Alf Eaton
2024-02-09 09:06:42 +00:00
committed by Copybot
parent 2566dff9d8
commit c997d1dc2b
19 changed files with 73 additions and 204 deletions
@@ -1,8 +1,6 @@
import { useRef, useEffect, type FC } from 'react'
// @ts-ignore
import Linkify from 'react-linkify'
import useIsMounted from '../../../shared/hooks/use-is-mounted'
import { configureMathJax } from '../../mathjax/configure'
import { loadMathJax } from '../../mathjax/load-mathjax'
import { debugConsole } from '@/utils/debugging'
@@ -18,18 +16,6 @@ const MessageContent: FC<{ content: string }> = ({ content }) => {
a.setAttribute('rel', 'noreferrer noopener')
}
// MathJax v2 typesetting
if (window.MathJax?.Hub) {
const { Hub } = window.MathJax
const timeout = setTimeout(() => {
configureMathJax()
Hub.Queue(['Typeset', Hub, root.current])
}, 0)
return () => clearTimeout(timeout)
}
// MathJax v3 typesetting
loadMathJax()
.then(MathJax => {