我正在使用 TinyMce 从数据库中插入/编辑文本,但我不知道为什么 <br />
的不见了。没有新行,即使我按下 ENTER 或 SHIFT + ENTER。
TinyMce 初始化:
tinyMCE.init({
mode : "textareas",
theme : "simple",
force_p_newlines : false,
force_br_newlines : true,
convert_newlines_to_brs : false
});
最佳答案
根据TinyMCE documentation for force_br_newlines
:
This option is deprecated as of 3.5 use forced_root_blocks: false instead to control p vs br behavior.
从版本 3.0a1 开始,forced_root_block
默认情况下启用。 The documentation also says如果禁用此选项,Enter 将生成 <br />
, 而 Shift+Enter 将产生 <p>
.
试试这个:
tinyMCE.init({
mode : "textareas",
theme : "simple",
forced_root_block : false,
});
关于javascript - TinyMce 没有插入 <br/>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11994354/