Fix mathjax error (#287)

* Updated mathjax and better-react-mathjax
* Removed MathJaxWrapper. Per better-react-mathjax documentation, we were incorrectly including a new context for every equation using this wrapper.
* Wrapped entire game in a MathJaxContext at GameRoot.
This commit is contained in:
Snarling
2023-01-03 07:38:14 -05:00
committed by GitHub
parent 77894cd9e5
commit dc0de2498b
188 changed files with 1559 additions and 2220 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import Typography from "@mui/material/Typography";
import { Player } from "@player";
import { Money } from "../../ui/React/Money";
import { MathJaxWrapper } from "../../MathJaxWrapper";
import { MathJax } from "better-react-mathjax";
type IProps = {
rerender: () => void;
@@ -30,7 +30,7 @@ export function CoresButton(props: IProps): React.ReactElement {
}
return (
<Tooltip title={<MathJaxWrapper>{`\\(\\large{cost = 10^9 \\cdot 7.5 ^{\\text{cores}}}\\)`}</MathJaxWrapper>}>
<Tooltip title={<MathJax>{`\\(\\large{cost = 10^9 \\cdot 7.5 ^{\\text{cores}}}\\)`}</MathJax>}>
<span>
<br />
<Typography>
+2 -2
View File
@@ -10,7 +10,7 @@ import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases";
import { Money } from "../../ui/React/Money";
import { numeralWrapper } from "../../ui/numeralFormat";
import { MathJaxWrapper } from "../../MathJaxWrapper";
import { MathJax } from "better-react-mathjax";
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
type IProps = {
@@ -35,7 +35,7 @@ export function RamButton(props: IProps): React.ReactElement {
return (
<Tooltip
title={
<MathJaxWrapper>{`\\(\\large{cost = ram \\cdot 3.2 \\cdot 10^4 \\cdot 1.58^{log_2{(ram)}}} ${bnMult}\\)`}</MathJaxWrapper>
<MathJax>{`\\(\\large{cost = ram \\cdot 3.2 \\cdot 10^4 \\cdot 1.58^{log_2{(ram)}}} ${bnMult}\\)`}</MathJax>
}
>
<span>