自己一直在使用着EditorMD编辑器插件,但是在EditorMD编辑器下是没有办法使用Handsome主题自带的增强功能的。

比如Handsome的引用标签,隐藏等功能,都得手打,这样长期一来显得非常不便,这里看到了有人对二者做了整合,于是便分享一下。

Handsome主题下整合EditorMD编辑器插件.png

首先找到站点根目录下 /usr/plugins/EditorMD/Plugin.php文件,修改157行 toolbarIcons 函数,为其增加个按钮 "custom_hide",修改如下:

toolbarIcons: function () {
                            return ["undo", "redo", "|", "bold", "del", "italic", "quote", "h1", "h2", "h3", "h4", "|", "list-ul", "list-ol", "hr", "|", "link", "reference-link", "image", "code", "preformatted-text", "code-block", "table", "datetime"<?php echo $editormd->emoji ? ', "emoji"' : ''; ?>, "html-entities", "more", "|", "goto-line", "watch", "preview", "fullscreen", "clear", "|", "help", "info", "|", "isMarkdown","custom_hide"]
                        },

然后覆盖 /usr/plugins/EditorMD/js/editormd.min.js文件即可。

https://cdn.jsdelivr.net/gh/Rintarou416/blog-cdn/plugins/EditorMD/js/editormd.min.js

如果觉得我的文章对你有用,请随意赞赏