Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
});
like image 937
Reteras Remus Avatar asked Aug 16 '12 19:08

Reteras Remus


1 Answers

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,
});
like image 62
Peter-Paul van Gemerden Avatar answered Sep 18 '22 17:09

Peter-Paul van Gemerden