CKEditor removing empty tags

Brenden Kehren asked on July 29, 2014 01:55

I've got a design that has a < span > wrapped in a < span > for a font feature to display an icon similar to how the Bootstrap uses <i class="icon-phone"></i> . The CKEditor strips the empty < span > out.

Isn't there a setting to correct this without having to use &nbsp; or some other hack?

<span><span class="fa fa-phone"></span>555-555-5555</span>

Correct Answer

Ondrej Sevcik answered on July 29, 2014 10:30

Hi, you could insert into CKEditor config.js file following line:

CKEDITOR.dtd.$removeEmpty['span'] = false;

It works for me.

4 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.