Skip to content


代码高亮插件

将 WordPress “选项”—>“写作”—>“自动修正错误的内嵌式 XHTML 语法”禁用,并在选项和用户中把所见即所得编辑器关掉.

测试代码加亮:

来自http://www.coolcode.cn/?p=26&pp=3
使用的语法是:


代码


如果要加亮具体的语言,可以用 lang 属性来指定:



代码


如果不需要行号,可以使用 linenum 属性来指定:



代码


如果希望可以直接以文件下载代码,可以使用 download 属性来指定:

下载: example.txt


代码

这三个属性可以组合使用,互不影响。

目前支持的程序设计语言有:

actionscript
cpp
css
diff
dtd
html
java
javascript
mysql
perl
php
python
ruby
sql
xml

Posted in WordPress, 其它.


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.