Merge pull request 'new line bug has been fixed' (#143) from fix/markdown into develop
Reviewed-on: http://85.143.176.51:3000/free-land/front-end/pulls/143
This commit is contained in:
commit
e97d3abe96
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user