Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove p tags that are auto added within tinymce

I am using tinymce 4.0.1 and it automatically adds p tags when you either start typing or hit enter. How can I dynamically remove these p tags and then reinsert the content into the editor.

like image 670
Juan Gonzales Avatar asked Sep 05 '25 03:09

Juan Gonzales


1 Answers

you need to add the following line to your init statement

forced_root_block : ""

So, your complete code will be like this:

    <script>tinymce.init({forced_root_block : "",selector:'textarea'});</script>
like image 164
turco_7 Avatar answered Sep 07 '25 22:09

turco_7