discuz需要输入两次回车才换行问题的正确解决方案
2017/09/21    

找到/static/js/editor.js

替换ctlent方法为

function ctlent(event) {
    if(postSubmited == false && (event.ctrlKey && event.keyCode == 13) || (event.altKey && event.keyCode == 83) && editorsubmit) {
        if(in_array(editorsubmit.name, ['topicsubmit', 'replysubmit', 'editsubmit']) && !validate(editorform)) {
            doane(event);
            return;
        }
        postSubmited = true;
        editorsubmit.disabled = true;
        editorform.submit();
        return;
    }
    if (ctlent_enable[13] && event.keyCode == 13 && wysiwyg) {
        //设置回车输入br标签
        if (!BROWSER.opera) {
            insertText('<br>*', 5, 0);
        } else {
            insertText('<br> ', 5, 0);
        }
        keyBackspace();
        doane(event);
    }
    if(ctlent_enable[9] && event.keyCode == 9) {
        if(!wysiwyg) {
            insertText('\t', 1, 0);
        }
        doane(event);
    }
    if(ctlent_enable[8] && event.keyCode == 8 && wysiwyg) {
        var sel = getSel();
        if(sel) {
            insertText('', sel.length - 1, 0);
            doane(event);
        }
    }
}

看看是否缺失keyBackspace方法

function keyBackspace() {
    if(!wysiwyg) {
        return;
    }
    if(BROWSER.ie) {
        sel = editdoc.selection.createRange();
        sel.moveStart('character', -1);
        sel.moveEnd('character', 0);
        sel.select();
        editdoc.selection.clear();
    } else {
        editdoc.execCommand('delete', false, true);
    }
}

而在CKEDITOR编辑器就有相关配置CKEDITOR.ENTER_BR/CKEDITOR.ENTER_P/CKEDITOR.ENTER_div可供选择;