【问题标题】:ckeditor - can't disable advanced content filterckeditor - 无法禁用高级内容过滤器
【发布时间】:2013-06-30 20:14:27
【问题描述】:

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

【问题讨论】:

    标签: php javascript mysql ckeditor


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2014-01-25
      • 1970-01-01
      • 2014-04-09
      • 1970-01-01
      • 2015-04-27
      • 2017-03-09
      • 2021-02-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多