WordPress.org

Forums

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

  1. feuerkralle
    Member
    Posted 11 months 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:
    <p>&nbsp;</p>

    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.

    Frank

    https://wordpress.org/plugins/tinymce-advanced/

  2. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 11 months 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
    Member
    Posted 11 months 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.

    Cheers,
    Frank

Reply

You must log in to post.

About this Plugin

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

About this Topic