theblang
theblang

Reputation: 10425

Prevent CKEditor from removing span elements

If I paste

<p class="foo">Some text: <span class="bar"></span> More text.</p>

into the editor as source then the span element will be removed when switching back to text edit mode. Is there a way to prevent this from happening?

Upvotes: 0

Views: 1104

Answers (1)

theblang
theblang

Reputation: 10425

The answer is in this forum post.

Before creating my CKEditor (I personally am using the jQuery adapter, but this config option should work either way) I set CKEDITOR.dtd.$removeEmpty.span = 0.

Also see this doc page.

Upvotes: 1

Related Questions