markeditor css,Editor.md构建Markdown富文本编辑器

a7850c16cf5fe110c6a43fa10fedaf3a.png

8d356dd126880af192ae902c3e671bd1.png

插件描述: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,  // 默认不解析

});

})

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值