|
|
|
@@ -1,12 +1,13 @@ |
|
|
|
import MarkdownIt from 'markdown-it' |
|
|
|
import { useEffect, useState } from 'react' |
|
|
|
import MdEditor from 'react-markdown-editor-lite' |
|
|
|
|
|
|
|
import WikiMarkdown from '@/components/WikiMarkdown' |
|
|
|
import Label from '@/components/common/Label' |
|
|
|
import { apiPost } from '@/lib/api' |
|
|
|
|
|
|
|
import type { FC } from 'react' |
|
|
|
|
|
|
|
const mdParser = new MarkdownIt |
|
|
|
import type { WikiAsset } from '@/types' |
|
|
|
|
|
|
|
type Props = { |
|
|
|
title: string |
|
|
|
@@ -60,7 +61,7 @@ export default (({ title: initTitle, body: initBody, onSubmit, id }: Props) => { |
|
|
|
<MdEditor |
|
|
|
value={body} |
|
|
|
style={{ height: '500px' }} |
|
|
|
renderHTML={text => mdParser.render (text)} |
|
|
|
renderHTML={text => <WikiMarkdown body={text} preview/>} |
|
|
|
onChange={({ text }) => setBody (text)} |
|
|
|
onImageUpload={handleImageUpload}/> |
|
|
|
</div> |
|
|
|
|