Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

insert line break instead of <p> in TinyMCE

Tags:

tinymce

I have initialised TinyMCE as follows. I want to force line breaks when user presses enter and not the paragraphs. I'm trying following, but not working. I'm using TinyMCE version 3_3_8.

tinyMCE.init({
        mode: "exact",
        theme: "advanced",
        elements: "textAreaId",
        cleanup: false,
        theme_advanced_toolbar_location: "",
        theme_advanced_buttons1: "",
        theme_advanced_buttons2: "",
        theme_advanced_buttons3: "",
        height: 200,
        width: 300,
    forced_root_block : false,
    force_br_newlines : true,
    force_p_newlines : false,
        oninit: InitPosition
    }); //init ends

I tried to define forced_root_block : "", but still it is not working.

What am I doing wrong?

like image 469
KutePHP Avatar asked Aug 24 '10 07:08

KutePHP


People also ask

How do I remove powered by TinyMCE?

Use the branding option to disable the “Powered by Tiny” link displayed in the status bar for product attribution. Important: Product attribution is required for free and open source users. For information on TinyMCE attribution requirements, see: Logo & attribution requirements.

How do I hide the bar in TinyMCE?

To disable the toolbar, the toolbar option should be provided a boolean value of false .


1 Answers

Simply add forced_root_block : false

Or if you want a wrapper: forced_root_block : 'div',

Works like a charm!

like image 189
Thanh Trung Avatar answered Sep 25 '22 13:09

Thanh Trung