import React from "react"; /* -------------------------------------------------------------------------- */ /* MarkDown */ /* -------------------------------------------------------------------------- */ import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; /* -------------------------------------------------------------------------- */ /* Components */ /* -------------------------------------------------------------------------- */ import Typography from "./typography/Typography"; import Heading from "./typography/Heading"; /* -------------------------------------------------------------------------- */ /* Code */ /* -------------------------------------------------------------------------- */ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { dark } from "react-syntax-highlighter/dist/esm/styles/prism"; import Link from "./typography/Link"; import { indexOf } from "lodash"; export type Props = { markdown: string; }; const Markdown = ({ markdown }: Props) => { let newMarkdown = markdown.replace(/\n/g, " \n"); return ( { return ( {props.children} ); }, code({ node, inline, className, children, ...props }) { const match = /language-(\w+)/.exec(className || ""); return !inline && match ? ( ) : ( {children} ); }, }} /> ); }; export default Markdown;