Markdown在线编辑器editor.md使用方法(PHP)

1,官网下载

下载地址:http://editor.md.ipandao.com
image

2,ThinkPHP5.1引入

在static下面新建文件夹md,将下载好的文件引入过来,
image

3,新建方法视图文件


<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
    <link rel="stylesheet" href="/static/md/editormdmaster/css/editormd.css"/>
</head>
<body>

<div id="test-editor">
    <textarea style="display:none;">### 关于 Editor.md
**Editor.md** 是一款开源的、可嵌入的 Markdown 在线编辑器(组件),基于 CodeMirror、jQuery 和 Marked 构建。
    </textarea>
</div>

<script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="/static/md/editormdmaster/editormd.min.js"></script>
<script type="text/javascript">
    $(function() {
        var editor = editormd("test-editor", {
            // width  : "100%",
            // height : "100%",
            path   : "/static/md/editormdmaster/lib/"
        });
    });
</script>
</body>
</html>

4,预览

image

image

posted @ 2022-07-07 18:36  79524795  阅读(504)  评论(0编辑  收藏  举报