new line bug has been fixed

This commit is contained in:
“Salar 2022-10-12 19:04:52 +03:00
parent 81faa7121e
commit eff1a2a04f

View File

@ -15,19 +15,22 @@ import Heading from "./typography/Heading";
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* Code */ /* Code */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { dark } from 'react-syntax-highlighter/dist/esm/styles/prism'; import { dark } from "react-syntax-highlighter/dist/esm/styles/prism";
import Link from "./typography/Link"; import Link from "./typography/Link";
import { indexOf } from "lodash";
export type Props = { export type Props = {
markdown: string; markdown: string;
}; };
const Markdown = ({ markdown }: Props) => { const Markdown = ({ markdown }: Props) => {
let newMarkdown = markdown.replace(/\n/g, " \n");
return ( return (
<ReactMarkdown <ReactMarkdown
remarkPlugins={[remarkGfm]} remarkPlugins={[remarkGfm]}
children={markdown} children={newMarkdown}
components={{ components={{
h1: Heading, h1: Heading,
h2: Typography, h2: Typography,