Skip to content

Commit

Permalink
Show fallback while katex is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ginnyTheCat committed Apr 24, 2022
1 parent f725713 commit 828d33b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/util/twemojify.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ const Math = lazy(() => import('../app/atoms/math/Math'));

const mathOptions = {
replace: (node) => {
if (node.attribs?.['data-mx-maths']) {
const maths = node.attribs?.['data-mx-maths'];
if (maths) {
return (
<Suspense fallback={<div />}>
<Suspense fallback={<code>{maths}</code>}>
<Math
content={node.attribs['data-mx-maths']}
content={maths}
throwOnError={false}
errorColor="var(--tc-danger-normal)"
displayMode={node.name === 'div'}
Expand Down

0 comments on commit 828d33b

Please sign in to comment.