There is a problem with CKEditor when the user inserts empty tags:
(in HTML source mode)
<a href="fds" class="doIt"></a>
When he presses on the source and then back again, the tag 'A' is gone. I made a little research, and I found that this happens since there is a very complicated function in ckeditor.js that checks whether there is a value inside the element. If there's none the CKEditor drops the tag.
I know this is old, but in CKEDITOR 4.x you can do:
CKEDITOR.dtd.$removeEmpty.ElementHere = 0;
Replace ElementHere with whatever tag you want. Like allowing empty i tags for icons:
CKEDITOR.dtd.$removeEmpty.i = 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With