2013-06-30 15 views
1

CKEditor很不錯,但它會去掉所有的html標籤和css。這是因爲他們的新高級內容過濾器。這毀了我所有的網頁佈局。ckeditor - 無法禁用高級內容過濾器

我試着在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'; 
}; 

回答

0

任何明顯的錯誤,我意識到這個問題是不是CKEditor的。我在PHP中通過htmlentities()striptags()傳遞數據,該數據刪除了所有標記。我現在只有mysql_escape_string()檢查數據。有沒有更多的功能可以用來清理數據而不會搞亂佈局?