第二部:修改 kindeditor/plugins/code/ 下的 code.js:
修改成:html = '<pre class="prettyprint' + cls + '">n' + K.escape(code) + '</pre> ';
第三步:在需要显示代码高亮的文章页头部引入 shCore.js 和 shCoreDefault.css,以phpcms为例:html = '<pre class="brush:' + type + ';
toolbar:false">n' + K.escape(code) + '</pre>';
第四步:在文章页底部加入调用的js代码:<script type="text/javascript" src="{
JS_PATH}
kindeditor/plugins/code/shCore.js"></script><link href="{
JS_PATH}
kindeditor/plugins/code/shCoreDefault.css" rel="stylesheet" type="text/css" />
大家可以看看,把phpcms自带的编辑器换成kindeditor<script> SyntaxHighlighter.all();
</script>
(责任编辑:网页模板)