2012-01-05 28 views
4

在我的WordPress博客上,我使用wp-sytax插件来格式化代码片段。为什么Wordpress更改小于和大于符号?

在HTML视图我有以下代码:

<pre lang="c"> 
#include<stdio.h> 
</pre> 

但在普通视图它显示:

#include&lt;stdio.h&gt; 

我怎样才能让#include<stdio.h>显示为我输入了吗?

+4

您可能会更好张贴到http:// wordpress.stackexchange.com – 2012-01-05 15:47:47

回答

3

添加escaped="true",告诉代码不应该是被转换为实体引擎:

<pre lang="c" escaped="true"> 
#include<stdio.h> 
</pre> 

(见例4的the Documentation

+1

Wov .......工作....! – 2012-01-05 15:53:10

0

您需要稍微修改该插件并按照this post中所述转义字符。

//$geshi = new GeSHi($code, $language); 
$geshi = new GeSHi(htmlspecialchars_decode($code), $language); 

上面的转义是使用htmlspecialchars _decode完成的。

相关问题