0
我想使用<(標籤)> tag以及<(span)> margin-left(屬性跨度)標籤中的class =「」屬性,但ckeditor會自動替換標籤標籤和class中的標籤,並且還會刪除邊距屬性來自span標籤中的style屬性如何完全禁用ckeditor中的自動更改?
我想使用<(標籤)> tag以及<(span)> margin-left(屬性跨度)標籤中的class =「」屬性,但ckeditor會自動替換標籤標籤和class中的標籤,並且還會刪除邊距屬性來自span標籤中的style屬性如何完全禁用ckeditor中的自動更改?
Ckeditor默認應用ACF(高級內容過濾器)。如果您不想應用此您可以禁用在您的配置文件添加此:
CKEDITOR.config.allowedContent = true
這將允許所有類型的輸入到編輯器。你可以閱讀更多細節here。
CKEDITOR.editorConfig = function(config) {
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
'/',
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
{ name: 'paragraph', groups: [ 'list', 'blocks' ] },
{ name: 'document', groups: [ 'mode' ] }
];
config.removeButtons = 'Save,NewPage,Preview,Print,PasteText,PasteFromWord,Find,Replace,Scayt,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Outdent,Indent,CreateDiv,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,Subscript,Superscript,Strike,BidiLtr,BidiRtl,Language,Anchor,Flash,Table,HorizontalRule,PageBreak,Iframe,Styles,Format,Font,Maximize,ShowBlocks,About,SpecialChar,Templates';
config.extraAllowedContent = 'label';// This will allow label tag..
};
您必須編輯config.js文件。
我曾在我的項目中嘗試config.allowedContent = true,但它不適合我。你檢查這個鏈接瞭解更多關於添加屬性的信息http://stackoverflow.com/questions/15659390/ckeditor-automatically-strips-classes-from-div – aasiph