TinyMCE Advanced
How to remove additional p-tags (3 posts)

  1. feuerkralle
    Posted 2 years ago #

    Dear Andrew,
    I hope you can help me. When I add a new paragraph (by using the return-key), the editor always inserts an additional p-Tag:

    I don't like to eliminate the extra space by using CSS. Is there a way to prevent the editor inserting the extra paragraph?

    Thanks for your support.



  2. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 2 years ago #

    Yeah, I don't like keeping the empty paragraphs either but this was requested many many times by many users, so it was added in WP. It is the behavior in all text editors.

    Short answer: don't "type" more paragraphs than needed :)
    Long answer: it would need some filtering to remove the empty paragraphs on saving, can be something like content = content.replace( '\n\n&nbsp;\n\n', '\n\n' ); attached to the custom jQuery event fired on pre_wpautop.

  3. feuerkralle
    Posted 2 years ago #

    Dear Andrew,
    I am glad that you are not tired to give always the same answer ;-)
    Thank you for your reply. I thought maybe there is a more comfortable way to eliminate the unnecessary paragraphs.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • TinyMCE Advanced
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic