效果:

富文本编辑器 - wangEditor 插入代码

 

富文本编辑器 - wangEditor 插入代码

 

 

项目结构:

富文本编辑器 - wangEditor 插入代码

 

注意事项:

  • highlightJS 代码高亮插件,wangEditor 本身就是集成的highlightJS代码高亮插件。
  • wangEditor-1.3.12.js里找到var hashljs = flase,把它改成var hashljs = true,然后引入JS和css。

富文本编辑器 - wangEditor 插入代码

 

 

调整代码的字体和大小:

富文本编辑器 - wangEditor 插入代码

 

 

代码:

富文本编辑器 - wangEditor 插入代码

 

富文本编辑器 - wangEditor 插入代码

 

富文本编辑器 - wangEditor 插入代码

 

原始连接:

http://www.sojson.com/blog/36

http://www.kancloud.cn/wangfupeng/wangeditor/65742

 

相关文章:

  • 2021-04-14
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
  • 2022-01-28
  • 2022-12-23
猜你喜欢
  • 2022-02-05
  • 2021-06-08
  • 2021-12-03
  • 2021-09-29
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案