7
votes

I have an tinyMCE and I have to set the option "force_br_newlines: true", because when I don't do it, and I'm pushing "Enter" for example two times and look in the source-code, there is only one <br>.

But when I set the option on TRUE, I have a problem with my unsorted list. When the loaded text comes from my databse to the tinyMCE, it makes out of

<ul><li> MY TEXT </li><li> MY TEXT 2 </li><ul>

this-->

<ul><br /><li> MY TEXT </li><br /><li> MY TEXT 2 </li><br /><ul>

Is there a possibility to prevent this??? I dont want to have the <br /> in it! THANK YOU VERY MUCH FOR YOUR HELP!!!!!

3

3 Answers

1
votes

BR elements should only be used when you really have to (mostly never). Also as of 3.x the forced_root_block option is enabled by default so if you really want to disable paragraphs disable that one as well.

So add

tinyMCE.init({
        ...
        force_br_newlines : true,
        force_p_newlines : false,
        forced_root_block : '' // Needed for 3.x
});

BTW TinyMCE's official page suggests not to use BR elements for linebreaks.

0
votes

Add

tinyMCE.init {
    ...
    ...
    apply_source_formatting : false
}
0
votes

Did you include 'lists' in plugins settings?

tinymce.init({
    plugins: "lists link stylebuttons", // For example
    // ...
});