1

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?

mickmackusa
  • 43,625
  • 12
  • 83
  • 136
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596

1 Answers1

1

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
Craig
  • 9,335
  • 2
  • 34
  • 38
FredFloete
  • 627
  • 2
  • 13
  • 33
  • I have this problem but still doing this the JCE and also tinyMCE delete attributes like onclick and delete tag wrapping
    tag. Any idea?
    – Diego Quirós Oct 27 '14 at 04:06
  • Does this happen also when you edit the plain html source with TinyMCE? – FredFloete Oct 27 '14 at 08:37
  • Yes, I tried with both editor, but the only way it does not delete tags is disabling any wysiwyg editor. And of course I m logged as super user. – Diego Quirós Oct 27 '14 at 12:13
  • Maybe this helps: http://www.clarica.com.au/index.php?option=com_content&view=article&id=129:code-cleanup-issues-in-jce-a-tinymce-scripts-removed-etc&catid=10:free-joomla-video-tutorials-training&Itemid=28 or https://www.joomla-monster.com/blog/joomla-3-0/how-to-stop-joomla-editor-from-cleaning-some-html-elements – FredFloete Oct 27 '14 at 17:07
  • @DiegoQuirós [joomla.se] Stack Exchange went public as of April 29th, 2014. Whenever you have a Joomla question, please post it there. – mickmackusa Jul 25 '20 at 05:54