如何使用 Markdown 富文本编辑器 (pandao)
如何使用markdown富文本编辑器(pandao)
1.下载markdown编辑器
https://pandao.github.io/editor.md/examples/index.html
https://github.com/pandao/editor.md.git
2.放到你的项目中
我放到了 /vendor/bower_dl/
文件下
3. 在文件中加载
具体要看你把文件放到哪个目录,文件夹大家可以随意改
引入需要的css和js文件
<link rel="stylesheet" href="/vendor/bower_dl/editor.md/css/editormd.css" />
<script src="/vendor/bower_dl/editor.md/examples/js/jquery.min.js"></script>
<script src="/vendor/bower_dl/editor.md/editormd.js"></script>
<script type="text/javascript">
$(function() {
var testEditor = editormd("test-editormd", {
path : '/vendor/bower_dl/editor.md/lib/'
});
});
</script>
调用方法
<div id="test-editormd">
<textarea id="content" name="content" class="form-control" rows="14">{{ $content }}</textarea>
</div>
非常简单