如何禁用 CKeditor 删除标签

Khi*_*ran 3 html tags ckeditor

如何禁用 CKeditor 删除标签,<div>因为它认为不需要但我需要它?

谢谢。

Hom*_*oma 5

假设你已经像这样定义了你的编辑器:

var editor = CKEDITOR.replace( 'editor1' );
Run Code Online (Sandbox Code Playgroud)

然后添加这个配置:

editor.config.allowedContent = true;
Run Code Online (Sandbox Code Playgroud)

或者

config.js,只需添加这个

config.allowedContent = true;
Run Code Online (Sandbox Code Playgroud)