2012-08-16 41 views
4

我正在使用TinyMce從數據庫中插入/編輯文本,但我不知道爲什麼<br />丟失。沒有新行,即使我按ENTER或SHIFT + ENTER。TinyMce未插入<br />

TinyMCE的初始化:

tinyMCE.init({ 
    mode : "textareas", 
    theme : "simple", 
    force_p_newlines : false, 
    force_br_newlines : true, 
    convert_newlines_to_brs : false 
}); 

回答

13

按照TinyMCE documentation for force_br_newlines

該選項已廢棄使用3.5 forced_root_blocks:假的,而不是來控制p VS BR行爲。

從版本3.0a1開始,forced_root_block默認情況下處於啓用狀態。 The documentation also says如果您禁用此選項,則Enter將生成<br />,而Shift + Enter將生成<p>

試試這個:

tinyMCE.init({ 
    mode : "textareas", 
    theme : "simple", 
    forced_root_block : false, 
});