i am using ckeditor and i have vary strange issue.
it remove automatically empty <span>
for example
<span class="new-class"></span>
removed automatically.
i am searching for solution for last 2 days but no success. i try to put following code in
config.js
CKEDITOR.config.allowedContent = true;
but no success.
i also add following code in html where i use ckeditor but no success.
<script>
var editor = CKEDITOR.replace( 'editor1', {
allowedContent: true,
} );
</script>
thanks
I am using Django CMS 3, CKEditor 4.3 and I got the same problem using twitter bootstrap glyphicon. Looking at : http://ckeditor.com/forums/Support/Prevent-removal-of-empty-span-tags#forum-topic-top.
To allow empty span tag, I have added at the end of ckeditor/config.js
CKEDITOR.dtd.$removeEmpty.span = 0;
I came across this thread with the same problem and thought I'd post my solution. I didn't want CKEditor to remove any blank elements. Add the following to the bottom of your config.js file:
$.each(CKEDITOR.dtd.$removeEmpty, function (i, value) {
CKEDITOR.dtd.$removeEmpty[i] = false;
});
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