我的ckeditor有这样的配置:config.allowedContent = true
如果我将此代码插入编辑器:
<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"> </div>
</div>
It Strip <span id="errLastNameMsg"></span> with
thanks in advance for your's solution.
答案 0 :(得分:2)
CKEditor有一个忽略元素的选项,如果为空:CKEDITOR.dtd.$removeEmpty
默认情况下,会删除空的span元素。
使用它来允许空的span元素:
CKEDITOR.dtd.$removeEmpty.span = 0;