I have CKEditor on my web site. When I enter this code into source window:
<ul class="active">
<li>
<a href="#">
<img align="" alt="" border="0" src="/media/1.png" />
<h3>Headline</h3>
<span class="prec">from</span>
<span class="price">1</span>
</a>
</li>
</ul>
And then when I click Save it gets formatted to:
<ul class="active">
<li>
<a href="#"><img align="" alt="" border="0" src="/media/1.png" /> </a>
<h3>
<a href="#">Headline</a></h3>
<a href="#"><span class="prec">from</span> <span class="price">1</span> </a></li>
</ul>
Is it possible to completely turn off code reformatting? It also changes some other html codes (flash on page, for example)
Can anybody give me some advice?
There is documentation on formatting the HTML output.
CKEDITOR.htmlWriterhandles the writing of source HTML. Its options are summarized in the docs. For example you can turn on breaking inside an<a>like this:That way you should at least be able to get the editor to not put everything inside your anchors in one line.
However, I think you are looking for something like
sourceFormatting: nonebut I doubt that this exists. The editor needs to parse your HTML for validation and its WYSIWYG functionality, so it seems to always get evaluated on save, stored formatless and re-written in the source window when it is opened.In another question people try (mis-)using
protectedSourceto keep CKEditor off their HTML, but I did not try that.