CKEditor 很不错,但它去掉了所有的 html 标签和 css。这是因为他们新的高级内容过滤器。它破坏了我所有的网页布局。
我尝试在 config.js
中禁用它,但没有任何区别,我整天都在搞这个,并尝试了以下代码的许多变体。谁能在 config.js
CKEDITOR.editorConfig = function( config ) {
config.allowedContent = true;
// The toolbar groups arrangement, optimized for a single toolbar row.
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'styles' },
{ name: 'colors' },
];
// The default plugins included in the basic setup define some buttons that
// we don't want too have in a basic editor. We remove them here.
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,About,Others,Forms';
// Let's have it basic on dialogs as well.
config.removeDialogTabs = 'link:advanced';
};
最佳答案
我意识到问题不是出在 CKEditor 上。我在 PHP 中通过 htmlentities()
和 striptags()
传递数据,这会删除所有标记。我现在只有 mysql_escape_string()
检查数据。是否可以使用更多函数来清理数据而不弄乱布局?
关于php - ckeditor - 无法禁用高级内容过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17394452/