tinymce adding p tags automatically?

Im using tinymce and saving it to a database.

When I edit the saved content using tinymce and save again, it inserts a p tag at the beginning.

Editing the content over and over again leaves a large gap at the beginning of the content.

DOes anyone know a fix?


Solution 1:

TinyMce automatically add "<p>" in new lines. You can set this option in tinyMce initialization like this:

  tinyMCE.init({
      mode : "textareas",
      theme : "advanced",
      force_br_newlines : false,
      force_p_newlines : false,
      forced_root_block : '',
  });

Hope it will help

Fonski

Solution 2:

For me it worked by making "force_br_newlines : true" instead of false.

 tinyMCE.init({
      mode : "textareas",
      theme : "advanced",
      force_br_newlines : true,
      force_p_newlines : false,
      forced_root_block : ''
  });

I hope it helps