WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Advanced
Stop removing BR not working with WP 3.5? (13 posts)

  1. PlutonB
    Member
    Posted 1 year ago #

    Just upgraded to WP 3.5 and noticed that the golden function of keeping the P and BR tags stopped working.

    Did a fresh install of WP 3.5 with only Tiny MCE Advanced installed. Same thing happens.

    When editing posts/pages, the BR tags are removed after saving. P tags stay. Grateful for any help with this! Thanks!

    http://wordpress.org/extend/plugins/tinymce-advanced/

  2. beardedgit
    Member
    Posted 1 year ago #

    Try installing the Raw HTML plugin (http://wordpress.org/extend/plugins/raw-html/faq/) alongside TinyMCE Advanced.

  3. PlutonB
    Member
    Posted 1 year ago #

    Thanks for your reply. Installing Raw HTML made no difference unfortunately. Wrapping content in special tags is no option, since the site will be used by end users with no html knowledge.

  4. PlutonB
    Member
    Posted 1 year ago #

    You're link to raw html led me to another plugin though. For anyone experiencing the same issue as me, try this plugin alongside TinyMCE Advanced:

    http://wordpress.org/extend/plugins/preserved-html-editor-markup/installation/

  5. beardedgit
    Member
    Posted 1 year ago #

    Glad you're sorted, PlutonB.

    I know it makes no difference to you, as Raw HTML made no difference, but it's worth pointing out for others that it does content-wrapping without user intervention if it's set to "on by default", so users don't need HTML knowledge.

    I'm going to give Preserved HTML Editor Markup a try on my installation to see if it's better for me. Thanks for the heads-up!

  6. PlutonB
    Member
    Posted 1 year ago #

    Ah, I never noticed that setting! Anyway, it's working with the setup I ended up with now. Thanks for your help!

  7. Jon Brown
    Member
    Posted 1 year ago #

    I too have had problems with the "Stop removing the <p> and tags when saving and show them in the HTML editor" setting having no affect as well (on 3.5)

    I found that that the No WPautop plugin does seem to work though:
    http://wordpress.org/extend/plugins/no-wpautop/

    I liked having this functionality in TinyMCE Advanced and only need that one plugin for all my TinyMCE tweaking needs even though it seems like half the plugins I have installed offer to disable wpautop. Anyway, No WPAutop works for now...

  8. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 1 year ago #

    Looked several times and seems the "Stop removing BR tags..." works as expected?

    Pasting this in the Text editor: <p>123<br>456<br>789</p> is preserved. Some more info on how to reproduce the error and what exactly happens may help :)

  9. Jon Brown
    Member
    Posted 1 year ago #

    @Ozz - Now I'm unable to reproduce this :/ Perhaps it was a plugin conflict and has since gone away. The check box for "Stop removing..." is working as expected (not removing when checked, removing when not). (note: I'm now running 3.5.1)

  10. PlutonB
    Member
    Posted 1 year ago #

    Thanks for looking into this! Tried again on a fresh install with latest WP and Tiny MCE Advanced.

    Single BR-tags works good. What I want to be able to keep are double BR-tags, which have been working in the past. These steps reproduce my issue (using latest Chrome):

    Paste <p>123<br>456<br><br>789</p> in the html editor
    Switch to visual editor
    Switch back to html editor (the br tags have now been auto formatted to <br \> instead of <br>
    Save/Update
    The double br-tags have now been replaced with a p-tag

  11. menathor
    Member
    Posted 1 year ago #

    I seem to be having the same problem with multiple BR tags in a row

  12. crmb
    Member
    Posted 9 months ago #

    I have the same problem with 3.6

    I found out that the admin editor apply the "autop" formating while retrieving post_content from the database, so the multiple (saved in the database) "br" are removed (and replaced by p) when post is reloaded in the editor

    class-wp-editor.php (110) :
    add_filter('the_editor_content', 'wp_richedit_pre');

    formatting.php in wp_richedit_pre function (2539) :
    $output = wpautop($output);

    i think solution would be to remove the above line in formatting.php

    (And don't forget to add remove_filter( 'the_content', 'wpautop' ); in your template)

  13. crmb
    Member
    Posted 9 months ago #

    Actually just removing this line from wpautop function (formatting.php) may be enough

    $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);

    Then, no need to remove wpautop
    But of course i don't want to edit core files

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags