How to prevent the TinyMCE (JCE) plugin from cleaning up my code?

2.6k Views Asked by At

I am using JCE, and I've set everything about code cleanup (in configuration) to OFF. The editor is fixing it anyway. Here's an example:

<span class="inset-right">
    <h3>TOC</h3>
    <ol>
        <li><a href="#wstep">Wstęp</a></li>
        <li><a href="#jak_zaczac">Jak zacząć?</a></li>
        <li><a href="#spis_metod">Spis metod</a></li>
    </ol>
</span>

Will get changed to:

<h3>TOC</h3>
<ol>
    <li><a href="#one">One</a></li>
    <li><a href="#two">Two</a></li>
    <li><a href="#three">Three</a></li>
</ol>

I know it is inappropriate to put <h3> and <ol> inside of a <span> tag, but I do not have a choice here. I just want to turn off all of the code fixing and cleanup.

2

There are 2 best solutions below

0
On BEST ANSWER

Your code is invalid. Change span to div and all should be fine....

<div class="inset-right">
    <h3>TOC</h3>
    <ol>
        <li><a href="#wstep">Wstęp</a></li>
        <li><a href="#jak_zaczac">Jak zacząć?</a></li>
        <li><a href="#spis_metod">Spis metod</a></li>
    </ol>
</div>

Then it should work...

http://forum.joomla.org/viewtopic.php?p=2608692 has more information about modifying JCE for your code.

2
On

If disabling cleanup using cleanup: false, does not help you may define to put H3 and OL list into SPAN as valid. You may use the following settings depending on your version of tinymce: