SpringBoot使用editor.md插件,正确导包姿势
1.下载插件
github下载链接:https://github.com/pandao/editor.md
2.把文件夹导入/resources/static里面
3.打开static/editor.md-master/examples/full.html,复制,黏贴在templates文件夹下(我改名字为fullEditor了)
4. 打开当前文件,有以下几个地方需要改路径才能生效
css样式路径修改
<link rel="stylesheet" href="css/style.css" th:href="@{/editor.md-master/examples/css/style.css}"/>
<link rel="stylesheet" href="../css/editormd.css" th:href="@{/editor.md-master/css/editormd.css}" />
js样式路径修改
<script src="js/jquery.min.js" th:src="@{/editor.md-master/examples/js/jquery.min.js}"></script>
<script src="../editormd.js" th:src="@{/editor.md-master/editormd.js}"></script>
还有下面两个路径
图片上传路径
把上面七个路径修改完,即可
写个Controller,然后跳转到这个html,就能看到结果。