react-markdown-editor-lite 编辑器

一、编辑器  无序列表+有序列表有问题

// 导入React、react-markdown-editor-lite,以及一个你喜欢的Markdown渲染器
import * as React from 'react'
// npm i markdown-it -S
import MarkdownIt from 'markdown-it'
import MdEditor from 'react-markdown-editor-lite'

// 导入编辑器的样式
import 'react-markdown-editor-lite/lib/index.css';

// 初始化Markdown解析器
const mdParser = new MarkdownIt(/* Markdown-it options */);

// Finish!
function handleEditorChange({html, text}) {    
  console.log('handleEditorChange', html, text)
}
export default (props) => {
  return (
    <MdEditor
      style={{ height: "500px" }}
      renderHTML={(text) => mdParser.render(text)}
      onChange={handleEditorChange}
    />
  )
}
点到为止
原文地址:https://www.cnblogs.com/fger/p/14316411.html