Title: Goodbye Syntax Highlighter
Author: dwhitevisoft
Published: <strong>2012 年 8 月 14 日</strong>
Last modified: 2013 年 2 月 11 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

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

# Goodbye Syntax Highlighter

 作者：[dwhitevisoft](https://profiles.wordpress.org/dwhitevisoft/)

[下载](https://downloads.wordpress.org/plugin/goodbye-syntax-highlighter.0.1.2.zip)

 * [详情](https://cn.wordpress.org/plugins/goodbye-syntax-highlighter/#description)
 * [评价](https://cn.wordpress.org/plugins/goodbye-syntax-highlighter/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/goodbye-syntax-highlighter/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/goodbye-syntax-highlighter/#developers)

 [支持](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/)

## 描述

For years I’ve used [Alex Gorbatchev’s SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/).
It has served me well over the years. When I moved to WordPress I tried various 
plugins based on the library, such [SyntaxHighlighter Evolved](https://wordpress.org/extend/plugins/syntaxhighlighter/).

I’ve decided to start blogging using [Markdown](http://daringfireball.net/projects/markdown/).
Making this move I needed to find a way to highlight various bits of source code
in an easy way. There are many nice libraries that make this a snap, such as [google-code-prettify](http://code.google.com/p/google-code-prettify/)
or [highlight.js](http://softwaremaniacs.org/soft/highlight/en/). In the end I decided
to go with highlight.js, for the simple reason that it is automatic, working flawlessly
with Markdown’s code syntax output.

Great, but my existing source code examples use SyntaxHighlighter’s style for code
blocks (using `<pre class="brush: ruby;" />`, for example). I could have converted
things in a few ways:

 * Change the database
 * Write a JS script to convert the `<pre />` structure to `<pre><code /></pre>`
 * Write a JS script to call highlight.js’ `highlightBlock` method
 * Write a WP plugin and reformat things easily **Ding Ding Ding**

So there you have it. This WordPress plugin will go through and process your SyntaxHighlighter
style blocks into ones that highlight.js works with out-of-the-box. It will also
add the language that you have specified with the `brush` class and add it as a 
class on the `<code />` element ([following the HTML5 recommendation](http://www.w3.org/html/wg/drafts/html/master/text-level-semantics.html#the-code-element)).
Nothing is changed in the DB, so if you decide to go back to SyntaxHighlighter, 
you can without any issues.

### GeSHi

This plugin now supports conversion of [GeSHi](http://qbnz.com/highlighter/) style
code blocks! Now you can move from plugins such as [WP-Syntax](https://wordpress.org/extend/plugins/wp-syntax/)
and [WP-GeSHi-Highlight](https://wordpress.org/extend/plugins/wp-geshi-highlight)
to highlight.js.

GeSHi uses the syntax that is _close_ to SyntaxHighlighter, except instead of putting
the language in the `class` attribute, it uses the `lang` attribute. Similar to 
the SyntaxHighligher conversion, it will go through and process your GeSHi style
blocks into ones that highlight.js works with out-of-the-box. It will also add the
language that you have specified with the `lang` attribute and add it as a `class`
on the `<code />` element.

## 安装

Installation is standard and straight forward.

 1. Upload the `goodbye-syntax-highlighter` folder (and all it’s contents) to the `/
    wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 评价

此插件暂无评价。

## 贡献者及开发者

「Goodbye Syntax Highlighter」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ dwhitevisoft ](https://profiles.wordpress.org/dwhitevisoft/)

[帮助将「Goodbye Syntax Highlighter」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/goodbye-syntax-highlighter)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/goodbye-syntax-highlighter/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/goodbye-syntax-highlighter/)，或
通过[RSS](https://plugins.trac.wordpress.org/log/goodbye-syntax-highlighter/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/goodbye-syntax-highlighter/)。

## 更新日志

#### 0.1.0

 * Initial release

#### 0.1.1

 * Modified output to use the HTML5 recommended syntax highlighting class names,
   e.g. `language-ruby`. For more information, see [the HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/text-level-semantics.html#the-code-element)

#### 0.1.2

 * Added conversion of GeSHi style code blocks

## 额外信息

 *  版本 **0.1.2**
 *  最后更新：**13 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.1 或更高版本 **
 *  已测试的最高版本为 **3.5.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/goodbye-syntax-highlighter/)
 * 标签
 * [code](https://cn.wordpress.org/plugins/tags/code/)[Highlight](https://cn.wordpress.org/plugins/tags/highlight/)
   [highlight.js](https://cn.wordpress.org/plugins/tags/highlight-js/)[pre](https://cn.wordpress.org/plugins/tags/pre/)
   [syntax](https://cn.wordpress.org/plugins/tags/syntax/)
 *  [高级视图](https://cn.wordpress.org/plugins/goodbye-syntax-highlighter/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/reviews/?filter=1)

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

[查看全部评论](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/reviews/)

## 贡献者

 *   [ dwhitevisoft ](https://profiles.wordpress.org/dwhitevisoft/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/goodbye-syntax-highlighter/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://www.visoftinc.com/)