0.2.20 • Published 7 years ago
wrap-md-editor v0.2.20
React Component Based on Editor.md
The html template should includes the following tags.
css
<link rel="stylesheet" href="https://s0.meituan.net/xm/open-platform-static/editormd/css/editormd.css" />
js
<script src="//s0.meituan.net/xm/static/jquery/1.11.3/jquery.min.js"></script>
<script src="https://s0.meituan.net/xm/open-platform-static/editormd/editormd.js"></script>
Install
npm install wrap-md-editor -S
Example
the edit mode
import React, {Component} from 'react';
import {render} from 'react-dom';
import Editor from 'wrap-md-editor';
render(
<Editor config={
{
markdown: // testEditor.getMarkdown().replace(/`/g, '\\`')
`## Test
\`\`\`
console.log('what can i do for you')
\`\`\`
# 123123`,
onload: (editor, func) => {
let md = editor.getMarkdown();
let html = editor.getHTML();
debugger
}
}
}/>,
document.querySelector('#root')
);
the show mode
import React, {Component} from 'react';
import {render} from 'react-dom';
import Editor from 'wrap-md-editor';
render(
<Editor.EditorShow config={
{
markdown: // testEditor.getMarkdown().replace(/`/g, '\\`')
`## Test
\`\`\`
console.log('what can i do for you')
\`\`\`
# 123123`
}
}/>,
document.querySelector('#root')
);
Doc
Read the document for detail.
0.2.20
7 years ago
0.2.19
7 years ago
0.2.16
7 years ago
0.2.15
7 years ago
0.2.14
7 years ago
0.2.13
7 years ago
0.2.12
7 years ago
0.2.11
7 years ago
0.2.10
7 years ago
0.2.9
7 years ago
0.2.8
7 years ago
0.2.7
7 years ago
0.2.6
7 years ago
0.2.5
7 years ago
0.2.4
7 years ago
0.2.3
7 years ago
0.2.2
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago