前言:蘿蔔青菜各有所愛,因為個人需求所以需要在部落格中整合ueditor,並非是我不喜歡md語法 其實本篇的筆記的書寫最早也是在本地的md編輯器上完成的
1. 首先下載ueditor編輯器,然後重新命名檔案為ueditor,將資料夾複製到admin目錄
2. 開啟admin目錄的editor-js.php檔案 在檔案末尾處
    </script>
<?php endif;?>
之間插入以下程式碼
    <?php else:?>
<!--不開啟markdown時使用ueditor--> <!-- 配置檔案 -->
<script type="text/javascript" src="./ueditor/ueditor.config.js"></script> <!-- 編輯器原始碼檔案 -->
<script type="text/javascript" src="./ueditor/ueditor.all.min.js"></script> <!-- 語言包檔案(建議手動加在語言,避免在ie下有時因為載入語言失敗導致編輯器載入失敗) -->
<script type="text/javascript" src="./ueditor/lang/zh-cn/zh-cn.js"></script> <script type="text/javascript">
var editor = UE.getEditor('text')
</script>
3. 開啟 var\Typecho\Common\Paragraph.php檔案註釋掉152行的
    $text = Typecho_Common::lockHTML($text);
此處是否會對原有功能產生bug未知,如果不註釋掉 會對ue編輯器的部分程式碼高亮功能產生顯示bug
 

4. 開啟模版資料夾的footer.php 這裡我使用的是預設模版 所以路徑是\usr\themes\default 在

    <?php $this->footer(); ?>
的下面插入
    <script type="text/javascript" src="<?php $this->options->siteUrl(); ?>admin/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
<link rel="stylesheet" href="<?php $this->options->siteUrl(); ?>admin/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css" type="text/css" />
<script>
SyntaxHighlighter.all() //執行程式碼高亮
</script>
5.在\ueditor\third-party\SyntaxHighlighter 下的shCore.js中搜索
    textarea.appendChild(document.createTextNode(code));
在後面新增一句
    textarea.style.height = "100%";
此處是為了修正程式碼高亮時 雙擊程式碼全選出錯的BUG,新版的SyntaxHighlighter外掛中已經預設雙擊程式碼全選,去掉了以前的flash複製功能
關閉所有檔案儲存,並在個人設定頁面關閉markdown語法編輯選項。目前還沒仔細測試是否有BUG,也沒去調整圖片上傳的功能。 所以對於本文的修改內容請慎重使用。