Skip to content

Commit 767b544

Browse files
committed
feat: use @matejmazur/react-katex replace older
1 parent 460f00c commit 767b544

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: upload artifact
3333
uses: actions/upload-artifact@v2
3434
with:
35-
name: CryptoLearnWeb
35+
name: CryptoLearnWeb.zip
3636
path: |
3737
build/*
3838
docker/*

package-lock.json

Lines changed: 16 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@graphql-codegen/fragment-matcher": "^1.17.8",
1414
"@graphql-codegen/typescript-operations": "^1.17.8",
1515
"@graphql-codegen/typescript-react-apollo": "^2.0.6",
16+
"@matejmazur/react-katex": "^3.1.3",
1617
"@testing-library/jest-dom": "^4.2.4",
1718
"@testing-library/react": "^9.5.0",
1819
"@testing-library/user-event": "^7.2.1",
@@ -23,10 +24,10 @@
2324
"i18next": "^19.7.0",
2425
"i18next-browser-languagedetector": "^6.0.1",
2526
"i18next-http-backend": "^1.0.18",
27+
"katex": "^0.13.3",
2628
"react": "^16.13.1",
2729
"react-dom": "^16.13.1",
2830
"react-i18next": "^11.7.2",
29-
"react-katex": "^2.0.2",
3031
"react-markdown": "^4.3.1",
3132
"react-router-dom": "^5.2.0",
3233
"react-scripts": "3.4.3",

src/components/Markdown.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import ReactMarkdown from 'react-markdown'
33
import SyntaxHighlighter from 'react-syntax-highlighter'
44
import RemarkMathPlugin from 'remark-math'
5-
import { BlockMath, InlineMath } from 'react-katex'
5+
import TeX from '@matejmazur/react-katex'
66
import AdmonitionsPlugin from "remark-containers"
77
import { Callout } from './Callout'
88
import { IconName, Intent } from '@blueprintjs/core'
@@ -89,8 +89,8 @@ export const Markdown: React.FC<MarkdownProps> = ({ source }) => {
8989
renderers={{
9090
code: CodeBlock,
9191
inlineCode: InlineCode,
92-
math: ({ value }) => <BlockMath>{value}</BlockMath>,
93-
inlineMath: ({ value }) => <InlineMath>{value}</InlineMath>,
92+
math: ({ value }) => <TeX block>{value}</TeX>,
93+
inlineMath: ({ value }) => <TeX>{value}</TeX>,
9494
none: (props) => <MarkdownCallout intent='none' {...props} />,
9595
primary: (props) => <MarkdownCallout intent='primary' {...props} />,
9696
success: (props) => <MarkdownCallout intent='success' {...props} />,

typings/react-katex/index.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)