kindeditor-4.1.5编辑器整合Syntaxhighlighter代码高亮

kindeditor-4.1.5编辑器整合Syntaxhighlighter代码高亮
我使用的是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 = "<pre class="prettyprint" + cls + "">
" + K.escape(code) + "</pre> ";
 
修改为:
 
cls = type === "" ? "" : type,
html = "<pre class="brush:" + cls + "">
" + K.escape(code) + "</pre> ";
 
在到 kindeditorphpcode目录下找到 demo.php
打开插入一下代码,如果没有你需要的语言你可以到syntaxhighlighter/scripts/这个目录下查找你需要的语言加入即可
 
<script type="text/javascript" src="../syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="../syntaxhighlighter/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="../syntaxhighlighter/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="../syntaxhighlighter/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="../syntaxhighlighter/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="../syntaxhighlighter/scripts/shBrushXml.js"></script>
<link type="text/css" rel="stylesheet" href="../syntaxhighlighter/styles/shCoreDefault.css"/>