Editor.md
插件Editor.md
当插件放public
下
<-- 根据自己目录引入以下CSS文件 -->
<link rel="stylesheet" href="/static/plugins/editor_md/css/style.css" />
<link rel="stylesheet" href="/static/plugins/editor_md/css/editormd.css" />
<link rel="stylesheet" type="text/css" href="/static/plugins/editor_md/css/editormd.min.css" />
<-- 创建一个DIV 做为容器,注意id -->
<div id="blog_mdedit">
@csrf
<textarea id="articleContent" name="content" placeholder="本编辑器支持Markdown编辑,左边编写,右边预览" style="display:none;"></textarea>
</div>
<-- 引入以下JS文件 -->
<script src="/static/plugins/editor_md/js/jquery.min.js"></script>
<script src="/static/plugins/editor_md/editormd.min.js"></script>
<script src="/static/plugins/editor_md/editormd.js" type="text/javascript" charset="utf-8"></script>
<-- 配置以下编辑器信息 -->
<script type="text/javascript">
var blog_mdedit;
$(function() {
blog_mdedit = editormd("blog_mdedit", {
width : "73%",
height : 640,
syncScrolling : "single",
path : "/static/plugins/editor_md/lib/", // 插件下的lid
saveHTMLToTextarea : true
});
});
</script>
blog_mdedit.getMarkdown()
获取md语法文件内容blog_mdedit.getHTML()
获取html语法文件内容