Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<br/> tags is automatically getting added to html tags in ckeditor

Whenever I'm adding HTML contents via CKEditor it automatically appends a "br" tag at the end of each other html tags.

How can I remove it?

CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.config.shiftEnterMode = CKEDITOR.ENTER_P;
CKEDITOR.replace(elemId,
{
    resize_enabled: false,
    entities: false,
    basicEntities: false,
    entities_greek: false,
    entities_latin: false,
}
like image 879
harry Avatar asked Nov 12 '22 20:11

harry


1 Answers

Don't remove them!

They are there because the contenteditable implementation in Firefox (and I think other non-ie browsers needs them to be there in order to render the elements properly, and allow the caret to be placed in them.

CKeditor's export functions should automatically remove them from the markup, you I wouldn't worry about them unless they are causing a specific problem while you are editing.

like image 74
Nico Burns Avatar answered Nov 15 '22 11:11

Nico Burns