surmon-china / angular-admin

🔏 Admin client for surmon.me blog powered by @angular and Bootstrap4
MIT License
354 stars 113 forks source link

请问露珠的Markdown编辑器使用的是什么? #8

Closed 0xzxdx closed 7 years ago

0xzxdx commented 7 years ago

正准备重构自己的博客,打算前端用angular,所以继续一款markdown编辑器,能写能渲染那种,看到露珠的markdown编辑器,不知道是自己写的还是使用他人的插件。

surmon-china commented 7 years ago

编辑器分为两部分:

本项目中编辑器使用codemirror,因为codemirror是一款很成熟的代码编辑器,本身支持各种代码的高亮(方便markdown嵌入的代码在编辑模式下也能高亮),以及一些其他的如折叠、激活选中行、快捷键等操作,但本质其也是用h5中的contenteditable属性实现的。 所以,你可以自己实现,也可以使用这个插件。 具体实现的话,可以参考我这段代码: https://github.com/surmon-china/surmon.me/blob/master/components/common/vue-comment/comment.vue

解析器使用开源的库就可以了,我用的marked,这款解析器支持node,支持web,且具有健全的定制性,能保持解析效果的统一。