diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-04-12 08:51:47 +0200 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-04-12 08:51:47 +0200 |
commit | b0e85051cb95c0ce3a359f20862f80e4cdb091dd (patch) | |
tree | 7945d6bd98b229e646f8b3266c97b5f37335b38d /pages | |
parent | 6af043cae506bf5daad306a8dc3ccbb5ca3ab5cf (diff) |
github flavored markdown + html in markdown
Diffstat (limited to 'pages')
-rw-r--r-- | pages/post/[id].tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pages/post/[id].tsx b/pages/post/[id].tsx index 8f6dde8..4f5acf7 100644 --- a/pages/post/[id].tsx +++ b/pages/post/[id].tsx @@ -1,7 +1,8 @@ import { ReactNode } from 'react'; -import ReactMarkdown from 'react-markdown'; +import ReactMarkdownWithHTML from 'react-markdown/with-html'; import { readdirSync, readFileSync } from 'fs'; import { join } from 'path'; +import gfm from 'remark-gfm'; import Seperator from '../../components/seperator'; import Navbar from '../../components/navbar'; @@ -21,7 +22,9 @@ export interface ArticleMeta { } export function RenderedArticle(props: { content: string }) { - return <ReactMarkdown + return <ReactMarkdownWithHTML + plugins={[gfm]} + allowDangerousHtml children={props.content} renderers={{ image: Image, |