我使用一个名为CodeHighlighter的插件在我的Joomla2.5网站上使用JCE在文章中插入一个代码片段。
为了插入代码片段,我在JCE中执行以下操作:
我交换到HTML代码视图,例如,我插入如下内容:
<pre class="brush:java">
package com.tutorialspoint;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextStartedEvent;
public class CStartEventHandler
implements ApplicationListener<ContextStartedEvent>{
public void onApplicationEvent(ContextStartedEvent event) {
System.out.println("ContextStartedEvent Received");
}
}
</pre>这是很好的工作,除了这部分代码:<ContextStartedEvent>,这是由JCE消除的。我也尝试使用一个no WYSIWIG编辑器,没有问题。
因此,问题似乎是JCE将<ContextStartedEvent>视为标记,而不是我的Java代码片段的合法部分,因此删除它.
对于如何防止JCE删除这部分代码,您有什么想法吗?
发布于 2013-02-14 20:46:14
您可以尝试以下方法:
1. Go to Global Configuration
2. Click "Text Filters" Tab.
3. Change "Super Users" filter type to "no filtering"这将解决这样的问题。
https://stackoverflow.com/questions/14878037
复制相似问题