Title: CodeHighlighter
Author: iwongu
Published: <strong>2007 年 9 月 7 日</strong>
Last modified: 2012 年 6 月 18 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/code-highlighter.svg)

# CodeHighlighter

 由 [iwongu](https://profiles.wordpress.org/iwongu/) 開發

[下載](https://downloads.wordpress.org/plugin/code-highlighter.1.9.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/code-highlighter/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/code-highlighter/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/code-highlighter/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/code-highlighter/#developers)

 [技術支援](https://wordpress.org/support/plugin/code-highlighter/)

## 外掛說明

This plugin is a syntax highlighter for source code. It uses _GeSHi_ as fontifier
engine.

#### Usage

 1. Put the code snippet in a “` tag.
 2. Add the lang attribute to the code tag like the following. `<code lang="php">`
 3. Add the lineno attribute to the `<code>` tag after the lang tag if you wish to 
    start at a line other than 1. `<code lang="cpp" lineno="42">`
 4. If you do not add lang attribute, the `<code>` tag is handled normally.
 5. If you want to have border, add the style like the following to your .css file.`
    code { border: 1px dotted #ccc; padding: 0.2em 0.5em; }`
 6. You can use following languages in lang. `abap, actionscript, ada, apache, applescript,
    asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, 
    cpp-qt, cpp, csharp, css-gen, css, d, delphi, diff, div, dos, dot, eiffel, fortran,
    freebasic, genero, gml, groovy, haskell, html4strict, idl, ini, inno, io, java,
    java5, javascript, latex, lisp, lua, m68k, matlab, mirc, mpasm, mysql, nsis, objc,
    ocaml-brief, ocaml, oobas, oracle8, pascal, per, perl, php-brief, php, plsql, python,
    qbasic, rails, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql,
    tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, xpp, 
    z80`

**Note:** Version 1.9 adds support for `<code>` tags, however to ensure backwards
compatibility support for the `<pre>` tag will not be removed.

### Known issues

 1. Because this plugin uses regular expression to match string range from `<code lang
    ="some">` to “`, you can’t use `</code>` in your code snippet. If you must put 
    the `</code>` tag, you can put a space between `<` and `/code>` like `< /code>`.
    The `< /code>` is converted to `</code>` automatically by plugin.
 2. If you want to change the style, you should modify the plugin source file. 😛

## 安裝方式

 1. Unzip the plugin archive.
 2. Upload the directory to the `/wp-content/plugins/` directory
 3. Activate the plugin through the ‘Plugins’ menu in WordPress

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈CodeHighlighter〉的開發相關工作。

參與者

 *   [ iwongu ](https://profiles.wordpress.org/iwongu/)
 *   [ Ben Lobaugh (blobaugh) ](https://profiles.wordpress.org/blobaugh/)

[將〈CodeHighlighter〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/code-highlighter)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/code-highlighter/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/code-highlighter/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/code-highlighter/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/code-highlighter/)。

## 變更記錄

#### 1.9

 * Added plugin maintainer
 * Removed outdated links
 * Added support for the `<code>` tag
 * Fixed several HTML entity display issues
 * Line numbering now defaults to displaying line numbers starting at 1

## 中繼資料

 *  版本 **1.9**
 *  最後更新 **14 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 2.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.4.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/code-highlighter/)
 * 標籤:
 * [code highlighter](https://tw.wordpress.org/plugins/tags/code-highlighter/)[formatting](https://tw.wordpress.org/plugins/tags/formatting/)
   [post](https://tw.wordpress.org/plugins/tags/post/)[syntax highlight](https://tw.wordpress.org/plugins/tags/syntax-highlight/)
 *  [進階檢視](https://tw.wordpress.org/plugins/code-highlighter/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/code-highlighter/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/code-highlighter/reviews/)

## 參與者

 *   [ iwongu ](https://profiles.wordpress.org/iwongu/)
 *   [ Ben Lobaugh (blobaugh) ](https://profiles.wordpress.org/blobaugh/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/code-highlighter/)