开发者

How to create a self closing element in CKEditor?

I want to create a custom self closing node in CKeditor, is there a way to do this? My code so far:

this.videoElement = editor.document.createElement('cfwvideo');
this.videoElement.setAttribute('src', videoSource);
editor.insertEl开发者_如何学Pythonement(this.videoElement);


Ah found it, you'll have to add the control name to the $empty list in CKEDITOR.dtd like this: CKEDITOR.dtd.$empty['cfwvideo'] = 1;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜