2011-09-05 43 views
1

請幫忙。我使用tinyMCE作爲內聯編輯器。所以我需要當用戶在編輯模式按下輸入,然後將<br />而不是<p>。我閱讀說明書和常見問題解答並嘗試使用將p轉換爲tinyMCE上的

tinyMCE.init({ 
      'height' : '100%', 
      'widht':'100%', 
      'content_css' : styles + ',/sdtc-new/nc/interface/common/css/mce-editor.css', 
      'mode' : "specific_textareas", 
      'editor_selector' : prefix + o.id, 
      'theme':'advanced', 
     theme_advanced_buttons1: o.buttons.join(','), 
     theme_advanced_buttons2 : "", 
     **theme_advanced_buttons3 : "", 
    force_br_newlines : true, 
     force_p_newlines : false, 
     forced_root_block : '' // Needed for 3.x** 
     }); 

但是這並不奏效。實際上有一段時間,就像我刪除編輯區域中的所有內容並輸入新文本一樣。但我需要它始終如一地工作。請幫忙。 TinyMCE的3.4.4

回答

1

的版本,您將需要設置

tinyMCE.init({ 
    forced_root_block : false, 
    force_br_newlines : true, 
    force_p_newlines : false 
    ... 
}); 

TinyMCE的常見問題Here is a helpfull section

+0

你的意思是我使用它的順序不正確嗎?因爲我使用這個指令但是以其他順序。 – ZigZag

+0

順序無關緊要,但''不等於錯! – Thariama

+0

console.log(''== false); // true – ZigZag

相關問題