tinymce adding p tags automatically?

后端 未结 4 1108
名媛妹妹
名媛妹妹 2020-12-13 23:57

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 co

4条回答
  •  生来不讨喜
    2020-12-14 00:16

    TinyMce automatically add "

    " 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

提交回复
热议问题