ER.SHASHI TIWARI
ER.SHASHI TIWARI

Reputation: 917

CKEditor Configuration, why it remove id in span attribute?

my ckeditor has this configuration: config.allowedContent = true

If I insert this code into my editor:

<div class="col-xs-12">
 <input type="text" name="LastName" class="form-control" id="LastName">
        <div class="help-block animated fadeInDown">
        <span id="errLastNameMsg"></span>
       </div>
    </div>

this is a simple id <span id="errLastNameMsg"></span> with span content.

After Ckeditor compile it is.
 <div class="col-xs-12"><input class="form-control" id="LastName" 
    name="LastName" type="text" /> 
    <div class="help-block animated fadeInDown">&nbsp;</div>
    </div>


It Strip <span id="errLastNameMsg"></span> with &nbsp;

thanks in advance for your's solution.

Upvotes: 0

Views: 730

Answers (1)

Wizard
Wizard

Reputation: 3151

CKEditor has an option for ignoring elements if empty: CKEDITOR.dtd.$removeEmpty

By default, empty span elements are removed.

Use this to allow empty span elements:

CKEDITOR.dtd.$removeEmpty.span = 0;

Upvotes: 2

Related Questions