Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE strips off br tags in p tag

Tags:

tinymce

Here is the config I am using in tinymce.init function:

forced_root_block: 'p'
valid_elements : '+a[id|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title],strong/b,-em,i,strike,u,script,p[class|id|dir|align|style],ol,ul,li,br'

But the tinyMCE is stripping of <br>'s when we hit enter key. Something like this:

    <p><br/></p>

is getting sent as

    <p></p>

Does anyone know why this is happening I am using tinyMCE version 3.5.4.1.

like image 813
shwetha Avatar asked Dec 11 '25 14:12

shwetha


1 Answers

In your settings:

'remove_trailing_brs': false
like image 53
Goin Avatar answered Dec 16 '25 22:12

Goin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!