render page content based on tokens; ignore rendered content field
This commit is contained in:
1 parent
32d304b26f
commit
bb393becc4
8 files changed
+188
-15
No files matched your search
@@ -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))}
|
||||
/>
|
||||
))
|
||||
Reference in new issue
Block a user