컴퓨터/개발

ckeditor 에서 엔터시마다 p 태그 대신 br 태그가 적용되도록..

하늘치 2014. 2. 18. 13:22
반응형

출처 : http://ckeditor.com/forums/Support/trying-use-br-instead-p


ckeditor 에서 엔터시마다 p 태그 대신 br 태그가 적용되도록 하는 방법이다.


ckeditor 의 config 파일에 아래 코드를 추가하기만 하면 된다. 



config.enterMode = CKEDITOR.ENTER_BR;



보통 이렇게 들어갈 것이다..



CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here.
    // For the complete reference:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config

    config.enterMode = CKEDITOR.ENTER_BR;

    config.toolbar = [
        { name: 'document', items : [ 'Source' ] },
        { name: 'basicstyles', items : [ 'Bold','-','RemoveFormat' ] }, /*   ,'Italic'   */
        { name: 'paragraph', items : [ 'Blockquote' ] }, /*   'NumberedList','BulletedList','-',   */
        { name: 'clipboard', items : [ 'Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
        { name: 'links', items : [ 'Link','Unlink' ] },
        { name: 'insert', items : [ 'Image','HorizontalRule','PageBreak'] },
        { name: 'styles', items : [ 'Format','FontSize' ] }, /*   ,'Font'   */
        { name: 'tools' , items : [ 'Maximize'] }
    ];

};




반응형