9 lines
507 B
TypeScript
9 lines
507 B
TypeScript
import ReactMarkdown from "react-markdown";
|
|
import rehypeHighlight from "rehype-highlight";
|
|
import remarkGfm from "remark-gfm";
|
|
|
|
/** Raw HTML is intentionally not enabled, so Memos content cannot inject script or markup. */
|
|
export function Markdown({ content, compact = false }: { content: string; compact?: boolean }) {
|
|
return <div className={`markdown${compact ? " markdown-compact" : ""}`}><ReactMarkdown remarkPlugins={[remarkGfm]} rehypePlugins={[rehypeHighlight]}>{content}</ReactMarkdown></div>;
|
|
}
|