From 9939b1c8249249ab10b089080be211c77e87c14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CSalar?= <“salar.sali97@gmail.com”> Date: Fri, 21 Oct 2022 17:57:55 +0300 Subject: [PATCH] resolve headers, lists, link, paragraph.. --- src/components/Markdown.tsx | 134 ++++++++++++++++++++++++++++++++---- 1 file changed, 121 insertions(+), 13 deletions(-) diff --git a/src/components/Markdown.tsx b/src/components/Markdown.tsx index ff3dccc..f8e05b7 100644 --- a/src/components/Markdown.tsx +++ b/src/components/Markdown.tsx @@ -16,6 +16,7 @@ import Heading from "./typography/Heading"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { dark } from "react-syntax-highlighter/dist/esm/styles/prism"; import Link from "./typography/Link"; +import style from "react-syntax-highlighter/dist/esm/styles/hljs/a11y-dark"; export type Props = { markdown: string; @@ -27,19 +28,126 @@ const Markdown = ({ markdown }: Props) => { remarkPlugins={[remarkGfm]} children={markdown} components={{ - h1: Heading, - h2: Typography, - a: (props) => { - return ( - - {props.children} - - ); - }, + ul: ({ node, ...props }) => ( +