插件描述:Editor.md 是一款开源的、可嵌入的 Markdown 在线编辑器(组件),基于 CodeMirror、jQuery 和 Marked 构建。
Editor.md
前端引用css:
html文本框设置:
前端引用js:
引用代码片段:var testEditor;
$(function() {
$.get("examples/test.md", function(md){
testEditor = editormd("test-editormd", {
width: "98%",
height: 730,
path : 'lib/',
markdown : md,
codeFold : true,
saveHTMLToTextarea : true,
searchReplace : true,
htmlDecode : "style,script,iframe|on*",
emoji : true,
taskList : true,
tocm : true, // Using [TOCM]
tex : true, // 开启科学公式TeX语言支持,默认关闭
flowChart : true, // 开启流程图支持,默认关闭
sequenceDiagram : true, // 开启时序/序列图支持,默认关闭,
imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "examples/php/upload.php",
onload : function() {
console.log('onload', this);
}
});
});
})
读取markdown显示引入css文件:
读取markdown显示html实例:
这里写入md格式内容
读取markdown显示前端js调用
$(document).ready(function() {
var wordsView;
wordsView = editormd.markdownToHTML("wordsView", {
htmlDecode : "style,script,iframe", // you can filter tags decode
emoji : true,
taskList : true,
tex : true, // 默认不解析
flowChart : true, // 默认不解析
sequenceDiagram : true, // 默认不解析
});
})