tinymce adding p tags automatically?

panthro picture panthro · Dec 12, 2012 · Viewed 43.3k times · Source

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?

Answer

Fonski picture Fonski · Dec 12, 2012

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