找遍了百度和google都沒有解決方案,連discuz官方都沒有出來解決,至今其官網仍有這個問題。html
那就本身動手解決吧,順手打個補丁。雖然走了小路,可是能解決問題。fetch
解決方案:修改static/js/bbcode.jsgoogle
找到 html2bbcode()方法:code
if((allowhtml && fetchCheckbox('htmlon')) || trim(str) == '') { for(i in EXTRAFUNC['html2bbcode']) { EXTRASTR = str; try { eval('str = ' + EXTRAFUNC['html2bbcode'][i] + '()'); } catch(e) {} } str = str.replace(/<img[^>]+smilieid=(["']?)(\d+)(\1)[^>]*>/ig, function($1, $2, $3) {return smileycode($3);}); str = str.replace(/<img([^>]*aid=[^>]*)>/ig, function($1, $2) {return imgtag($2);}); return str; } //fix first enter cannot start new line var divPos = strpos(str,"<div>"); if(divPos > 0 ){ if(divPos > 4 && str.substr(divPos - 4,4) == '</p>'){} else{ str = str.substr(0,divPos) + '<br>'+ str.substr(divPos); } } //end