improve: support todo check list in md

This commit is contained in:
h z
2025-01-08 14:30:50 +00:00
parent 2837edef31
commit ed13196ef8
3 changed files with 279 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import ReactMarkdown from "react-markdown";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
import rehypeRaw from "rehype-raw";
import remarkGfm from "remark-gfm";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { okaidia } from "react-syntax-highlighter/dist/esm/styles/prism";
import "katex/dist/katex.min.css";
@@ -13,7 +14,7 @@ const MarkdownView = ({ content, height="auto" }) => {
<div className="markdown-preview" style={{height}}>
<ReactMarkdown
children={content}
remarkPlugins={[remarkMath]}
remarkPlugins={[remarkMath, remarkGfm]}
rehypePlugins={[rehypeKatex, rehypeRaw]}
components={{
code({ node, inline, className, children, ...props }) {