• TinyMCE Advanced has a crazy bug of inserting a non closed <p> before the whole code every time I load the code in the editor. I tried editing the tadv_replace.js file, but the only thing I could achieve was to stop converting <p> </p> into <p><br class=”spacer_” /></p>

    I go crazy, because after every save I simply have to delete a line from the start and end of a post.

    Is there any fix for this crazy bug, or any other plugin which converts line brakes into proper code, what wordpress is not zapping?

    I would be happy to turn off the <p> setting in TinyMCE Advanced, as long as I could find any other automated solution for line brakes.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter zsero

    (@zsero)

    OK, I’ve been digging into this. If this option is enabled, even in HTML mode, every save inserts a <p> before the whole article and a <p> </p> after the whole article. Next time, or when switching to the editor it closes it. Then it inserts an other. So every time you click on save, the page goes like this:

    code

    <p>
    <p>code</p>
    <p></p>
    <p>
    <p>code</p>
    </p>
    <p></p>
    <p></p>
    <p>code</p>
    </p>
    <p></p>
    <p>
    </p>
    <p>code</p>
    </p>
    <p></p>

    < HTML mode stops here

    Switching to TinyMCE goes further:

    <p> </p>
    <p> </p>
    <p>code</p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p>code</p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p>code</p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>

    The worst thing is that this way somehow TinyMCE Advanced ruins the HTML editor. HTML code should not be changed by a javascript! Do you know any solution?

    Thread Starter zsero

    (@zsero)

    Guys, really on the big big famous WP blogs, how do you insert multiple blank lines? TinyMCE Advanced is totally broken, hand editing the WP source files is a bad bad idea, what else can I do?

    I found this here:

    https://www.smoexpert.com/wordpress-stripping-out-your-line-break

    <br class=”blank” />

    Thread Starter zsero

    (@zsero)

    Thank you. Given there is no other solution I was using the same thing, but with:
    <br class=”spacer_”>

    It’s not a problem for me, but I just cannot tell someone who knows nothing about HTML to switch to HTML view and insert this line where you find it in the code! If you insert it in TinyMCE it encodes it into entities, what is correct, but useless for us.

    No I am actually looking into writing a plugin which puts a button on the toolbar for new line. If anyone knows anything about how to write a plugin like this, can you help me where to start looking?

    Thread Starter zsero

    (@zsero)

    OK, I found it:

    It is qTranslate what inserts a new line before the article everty time I click save! If used without TinyMCE Advanced, then the wordpress cleaner cleans the code, that why it’s not visible. If used with TinyMCE Advanced it saves the linebrakes and converts them into <br class… /> .

    So the bug is not in TinyMCE Advanced, it’s just visible when it’s turned on. The bug is in qTranslate!

    Thread Starter zsero

    (@zsero)

    If I click HTML mode just before clicking save, the bug is not present. Do you know any quick fix for this?

    I wrote a plugin that fixes the ‘incompatibility’ between qtranslate and tinymce advanced.

    Free for anyones use in unmodified form:

    <?php
    /*
    Plugin Name: Fix for qTranslate combined with no-remove-extra-line-breaks-option in tinymce-advanced plugin
    Plugin URI: https://breenstorm.nl/wordpress
    Description: Fixes the problem that after saving a page, an extra linebreak is placed above the content.
    Author: Breenstorm
    Version: 1.1
    Author URI: https://breenstorm.nl/wordpress
    */

    function fix_p_around_languagetag ($content = '') {
    $content = html_entity_decode($content);
    $content = str_replace("<p><!--", "<!--", $content);
    $content = str_replace("--></p>", "-->", $content);
    $content = htmlentities($content);
    return $content;
    }

    add_filter('htmledit_pre', 'fix_p_around_languagetag');
    add_filter('richedit_pre', 'fix_p_around_languagetag');
    ?>

    I’m interested by your plugin basz, I would like to try it.
    In which file do you put the code ? Thanks for your answer.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘is there line brake fix for TinyMCE Advanced or other solution?’ is closed to new replies.