最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - TinyMce not inserting <br > - Stack Overflow

programmeradmin1浏览0评论

I'm using TinyMce to insert/edit a text from a database, but I don't know why the <br />'s are missing. There are no new lines, even if I hit ENTER or SHIFT + ENTER.

TinyMce init:

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

I'm using TinyMce to insert/edit a text from a database, but I don't know why the <br />'s are missing. There are no new lines, even if I hit ENTER or SHIFT + ENTER.

TinyMce init:

tinyMCE.init({
    mode : "textareas",
    theme : "simple",
    force_p_newlines : false,
    force_br_newlines : true,
    convert_newlines_to_brs : false
});
Share Improve this question edited Aug 16, 2012 at 20:08 Peter-Paul van Gemerden 7,01132 silver badges37 bronze badges asked Aug 16, 2012 at 19:45 Reteras RemusReteras Remus 9335 gold badges19 silver badges34 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 14

According to the 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.

As of version 3.0a1, forced_root_block is enabled by default. The documentation also says that if you disable this option, Enter will produce a <br />, while Shift+Enter will produce a <p>.

Try this:

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

Update for version 6.1 or later:

newline_behavior: 'linebreak'
发布评论

评论列表(0)

  1. 暂无评论