render page content based on tokens; ignore rendered content field

This commit is contained in:
tmshv committed 2020-03-19 22:34:28 +03:00
1 parent 32d304b26f
commit bb393becc4
8 files changed
+188 -15

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { Html } from 'src/components/Html'
import MarkdownIt from 'markdown-it'
import Typograf from 'typograf'
import { memo } from 'react'
const tp = new Typograf({ locale: ['ru'] })
const md = new MarkdownIt({
html: true,
})
export type MarkdownProps = {
data: string
}
export const Markdown: React.SFC<MarkdownProps> = memo(props => (
<Html
html={tp.execute(md.render(props.data))}
/>
))