Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"diff": "^5.1.0",
"fast-deep-equal": "^3.1.3",
"immer": "^9.0.21",
"katex": "^0.16.11",
"lodash.flatten": "^4.4.0",
"lodash.get": "^4.4.2",
"lodash.isempty": "^4.4.0",
Expand Down
10 changes: 7 additions & 3 deletions src/Markdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Collapse, Divider, Typography } from 'antd';
import 'katex/dist/katex.css';
import { CSSProperties, memo } from 'react';
import ReactMarkdown from 'react-markdown';
import { PluggableList } from 'react-markdown/lib/react-markdown';
import rehypeKatex from 'rehype-katex';
import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';

import { PluggableList } from 'react-markdown/lib/react-markdown';
import { withProvider } from '..';
import { Code } from './CodeBlock';
import { useStyles } from './style';
Expand Down Expand Up @@ -49,7 +49,11 @@ const Markdown = memo<MarkdownProps>(
};

const rehypePlugins = [rehypeKatex, ...(outRehypePlugins || [])];
const remarkPlugins = [[remarkGfm,{singleTilde: false}], remarkMath, ...(outRemarkPlugins || [])];
const remarkPlugins = [
[remarkGfm, { singleTilde: false }],
remarkMath,
...(outRemarkPlugins || []),
];

return (
<Typography className={className} onDoubleClick={onDoubleClick} style={style}>
Expand Down