mymotherland
mymotherland

Reputation: 8228

How do disable auto add <br> end of every element in CKEditor?

I am using ckeditor in phpbb. when adding content in my post page. I am getting break tag between every line which look my page content odd.how can we disable the <br/> tag in ckeditor ?

updated my question

i have given CKEDITOR.ENTER_P in config.js

CKEDITOR.editorConfig = function( config )
{
    // Define changes to default configuration here. For example:

    config.enterMode = CKEDITOR.ENTER_P;
    config.toolbar_Basic =
[
    ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']
];

};

Upvotes: 1

Views: 4252

Answers (3)

Parisa
Parisa

Reputation: 801

you can set other behaviors to it :

CKEDITOR.ENTER_P (1) – new <p> paragraphs are created;
CKEDITOR.ENTER_BR (2) – lines are broken with <br> elements;
CKEDITOR.ENTER_DIV (3) – new <div> blocks are created.

Upvotes: 0

stefandoorn
stefandoorn

Reputation: 1032

In the config of ckeditor (config.js) you can define which tag will be inserted on ENTER. Mostly users switch between <br> or <p>, but you can also leave the configuration value empty over there.

Some information from the manual: here.

Upvotes: 4

user818845
user818845

Reputation:

I think, break tag is standard mechanism for enters. If you wan't to remove it, try clean your content before save to database str_replace('
', '', $content);

Upvotes: 1

Related Questions