Search code examples
javascripttinymce

TinyMce not inserting <br />


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
});

Solution

  • 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,
    });