Ckeditor 不保存按钮标签

Ckeditor not saving button tag

当我通过 ckeditor 输入保存 html 时,我错过了 html 内容中的标记。我是否必须执行任何 ckeditor 配置才能允许 html 标签,例如 html 内容?谢谢。

您必须在实例化 ckeditor 时使用 allowedContent 属性 以允许特定标签,或 allowedContent: true 以允许所有内容

https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent

为指定的文本区域使用 config.js 或 in-page 配置:

https://docs.ckeditor.com/ckeditor4/latest/guide/dev_configuration.html

在我的例子中(我使用的是 Symfony ckeditor bundle)我也可以通过 config.yml.

中的 bundle 配置来设置它