1

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';
};
4

1 回答 1

0

我意识到问题不是CKEditor。我正在通过 PHP 传递数据,htmlentities()striptags()在 PHP 中删除了所有标记。我现在只有mysql_escape_string()检查数据。是否还有其他功能可以用来清理数据而不会弄乱布局?

于 2013-06-30T21:27:57.400 回答