开发者

How to create a self closing element in CKEditor?

开发者 https://www.devze.com 2023-04-04 06:21 出处:网络
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\');

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

精彩评论

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