feat(client): add github flavored syntax and math equations to markdown support

This commit is contained in:
Amruth Pillai
2022-12-17 10:19:25 +01:00
parent 878659999f
commit 6b4a54465a
4 changed files with 168 additions and 1 deletions
+8 -1
View File
@@ -1,6 +1,9 @@
import clsx from 'clsx';
import { isEmpty } from 'lodash';
import ReactMarkdown from 'react-markdown';
import rehypeKatex from 'rehype-katex';
import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';
type Props = {
children?: string;
@@ -11,7 +14,11 @@ const Markdown: React.FC<Props> = ({ className, children }) => {
if (!children || isEmpty(children)) return null;
return (
<ReactMarkdown remarkPlugins={[]} className={clsx('markdown', className)}>
<ReactMarkdown
className={clsx('markdown', className)}
remarkPlugins={[remarkGfm, remarkMath]}
rehypePlugins={[rehypeKatex]}
>
{children}
</ReactMarkdown>
);