Blogger Information
Blog 119
fans 3
comment 1
visits 94632
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
editor.md插件部署到laravel
赵大叔
Original
754 people have browsed it

一、下载Editor.md插件

http://editor.md.ipandao.com/

二、拷贝插件到项目

  • 我把Editor.md当插件放public

三、创建一个视图

  1. <-- 根据自己目录引入以下CSS文件 -->
  2. <link rel="stylesheet" href="/static/plugins/editor_md/css/style.css" />
  3. <link rel="stylesheet" href="/static/plugins/editor_md/css/editormd.css" />
  4. <link rel="stylesheet" type="text/css" href="/static/plugins/editor_md/css/editormd.min.css" />
  5. <-- 创建一个DIV 做为容器,注意id -->
  6. <div id="blog_mdedit">
  7. @csrf
  8. <textarea id="articleContent" name="content" placeholder="本编辑器支持Markdown编辑,左边编写,右边预览" style="display:none;"></textarea>
  9. </div>
  10. <-- 引入以下JS文件 -->
  11. <script src="/static/plugins/editor_md/js/jquery.min.js"></script>
  12. <script src="/static/plugins/editor_md/editormd.min.js"></script>
  13. <script src="/static/plugins/editor_md/editormd.js" type="text/javascript" charset="utf-8"></script>
  14. <-- 配置以下编辑器信息 -->
  15. <script type="text/javascript">
  16. var blog_mdedit;
  17. $(function() {
  18. blog_mdedit = editormd("blog_mdedit", {
  19. width : "73%",
  20. height : 640,
  21. syncScrolling : "single",
  22. path : "/static/plugins/editor_md/lib/", // 插件下的lid
  23. saveHTMLToTextarea : true
  24. });
  25. });
  26. </script>

1、两个方法

blog_mdedit.getMarkdown() 获取md语法文件内容
blog_mdedit.getHTML() 获取html语法文件内容

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post