I am using CKEditor version 4.2.2 Drupal module. When I toggle the 'Source' button (swithing between Plain Text and Rich Text) I end up losing some tags. It seems that the CKEditor rewrites the HTML code. I did quite a bit of search so far about this and I added in the "Custom JavaScript configuration" (in the configuration section of the CKEditor module), this line of code:
config.allowedContent = true;
With the above code I had partial success, now it leaves alone more tags but for the following code:
<h2>404<i class="icon-file"></i></h2>
CKEditor rewrites it as:
<h2>404</h2>
It removes the empty i tags. The i tag above is for font icons.
How can I prevent CKEditor from rewriting the Markup when switching between Source View and WYSIWYG view?
The problem I have is that multiple users edit the same document and some use WYSIWYG editor while others use the Plain text view. And you see how things get messy.
Thanks.
<i>
already has a historical semantic meaning as "italic". There's no real point in using it for an icon. Use some other tag and it'll be nicer. – Joel Peltonen