Title: WP-Markdown-Syntax-Sugar
Author: dwhitevisoft
Published: <strong>2012 年 8 月 13 日</strong>
Last modified: 2013 年 1 月 3 日

---

搜索插件

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

![](https://s.w.org/plugins/geopattern-icon/wp-markdown-syntax-sugar.svg)

# WP-Markdown-Syntax-Sugar

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

[下载](https://downloads.wordpress.org/plugin/wp-markdown-syntax-sugar.0.1.1.zip)

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

 [支持](https://wordpress.org/support/plugin/wp-markdown-syntax-sugar/)

## 描述

WP Markdown Syntax Sugar work in conjunction with plugins such as [wp-markdown](https://wordpress.org/extend/plugins/wp-markdown/)

and [wp-highlight.js](https://wordpress.org/extend/plugins/wp-highlightjs/). Markdown
is fantastic markup for easily writing blogs, and [highlight.js](http://softwaremaniacs.org/soft/highlight/en/)
is an extremely easy way to highlight code examples. In most cases, highlight.js
automatically detects the proper language for a block of code. In certain cases,
primarily if your code example is short, highlight.js could improperly detect the
language that you are using; that is where this plugin comes into play. By adding
one line to your code blocks, you can explicitly set the language that you are using,
allowing highlight.js to properly format your code.

The concept is inspired by the [wp-markdown-syntax-highlight](https://github.com/spjwebster/wp-markdown-syntax-highlight)

plugin.

The usage is extremely simple. Just add a shebang as the first line of your code
example with the language you are using.

    ```
    #!ruby
    class Foo < Bar
      def hello
        puts "Hello World!"
      end
    end
    ```

The shebang is removed, and the code is outputted as:

    ```
    <pre><code class="language-ruby">class Foo < Bar
      def hello
        puts "Hello World!"
      end
    end</code></pre>
    ```

Now the code block is properly formatted for highlight.js to do its magic, and the
code snippet will be properly
 highlighted.

## 安装

Installation is standard and straight forward.

 1. Upload the `wp-markdown-syntax-sugar` folder (and all it’s contents) to the `/wp-
    content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Modify improperly formatted code blocks with a shebang.

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP-Markdown-Syntax-Sugar」是开源软件。 以下人员对此插件做出了贡献。

贡献者

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

[帮助将「WP-Markdown-Syntax-Sugar」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-markdown-syntax-sugar)

### 对开发感兴趣吗?

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

## 更新日志

#### 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.1**
 *  最后更新：**13 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.1 或更高版本 **
 *  已测试的最高版本为 **3.5.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-markdown-syntax-sugar/)
 * 标签
 * [code](https://cn.wordpress.org/plugins/tags/code/)[highlight.js](https://cn.wordpress.org/plugins/tags/highlight-js/)
   [markdown](https://cn.wordpress.org/plugins/tags/markdown/)[pre](https://cn.wordpress.org/plugins/tags/pre/)
   [syntax](https://cn.wordpress.org/plugins/tags/syntax/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-markdown-syntax-sugar/advanced/)

## 评级

尚未提交反馈。

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

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

## 贡献者

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

## 支持

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

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

## 捐助

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

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