MediaWiki扩展:语法高亮处理1
天下维客,你可以修改的网络知识库
本文取自元维基,欢迎共同翻译、整理与大家共享,促进中文wiki发展^_^
Adds color to source code using the PHP GeSHi (Generic Syntax Highlighter) library.
Tested with MediaWiki 1.5.1.
All the latest documentation, code, and a working examples are available at arandeltac.com.
[编辑]
Bug Warning and Fix
If you go to arandeltac.com and get this extension (well worth it) you need to edit the file GeSHiColor.php and change the line
function hookCode( $code, $args ) {
to
function codeHook( $code, $args ) {
if you want the <code></code> tags to work as advertised. Unfortunately these seems no way to contact the people who maintain the site.
You may also want to change this bit of code:
From:
if (!$type) { die('No language type defined for code block.'); }
Note - This caused some pages like the image description pages in MediaWiki to error out.
To:
if (!$type) {
return $code;
}
原文参见: GeSHiColor Extension


