一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

kindeditor编辑器整合Syntaxhighlighter代码高亮

时间:2013-10-14 编辑:简简单单 来源:一聚教程网

我使用的是kindeditor-4.1.5版本 

链接地址:http://kindeditor.googlecode.com/files/kindeditor-4.1.5.zip 

Syntaxhighlighter 代码高亮提示插件 网上就可以搜到 

   
步骤: 

   
1。找到kindeditor的code插件的code.js文件(在editor/plugins/code下)查找一下两行后删除或者注释掉 

 代码如下 复制代码

   
cls = type === "" ? "" :  " lang-" + type, 

html = "

 

" + K.escape(code) + "

"; 
   

修改为: 
   

cls = type === "" ? "" : type, 

html = "

 

" + K.escape(code) + "

"; 

   
在到 kindeditorphpcode目录下找到 demo.php 

打开插入一下代码,如果没有你需要的语言你可以到syntaxhighlighter/scripts/这个目录下查找你需要的语言加入即可 
   

 代码如下 复制代码

 

 

 

 

 

 


使用kindeditor插件为了使插入的代码高亮SyntaxHighlighter,但是代码过长不能换行,就解决方案

热门栏目