Why does JCE delete text in an article that looks like an html tag?

2k views Asked by At

I am using a plugin named CodeHighlighter to insert a code snippet inside articles in my Joomla 2.5 website using JCE.

To insert the code snippet, I do the following in JCE:

I swap to the HTML code view and, for example, I insert something like this:

<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>

This works well except for this part of code: <ContextStartedEvent> which is eliminated by JCE. I have also tried using a no WYSIWIG editor and there is no problem.

So the problem seems to be that JCE sees <ContextStartedEvent> as a tag and not as a legal part of my Java code snippet, and so deletes it...

Do you have some idea about how prevent JCE from deleting this part of code?

1

There are 1 answers

5
FredFloete On

You can try the following:

1. Go to Global Configuration
2. Click "Text Filters" Tab.
3. Change "Super Users" filter type to "no filtering"

This will solve problems such as these.

  • Youtube videos wont work in Joomla (code gets deleted)
  • JCE TinyMCE code cleanup deletes my styles code and scripts.
  • Inline document styles (css) gets removed by JCE or TinyMCE in Joomla
  • Code cleanup problems in JCE / TinMCE
  • Flash scripts being removed by JCE code cleanup