WordPress.org

Support

Support » How-To and Troubleshooting » How come I never get an answer about WP’s awful editor?

How come I never get an answer about WP’s awful editor?

  • I’ve left this before and NEVER get a response, so what’s the point?

    Every time I post a new piece it ends up with a sh*tload of these at the end of the doc? These from the latest. They’re not in the original doc so I assume WP in its ‘wisdom’ thinks I need them.

    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>

Viewing 15 replies - 31 through 45 (of 65 total)
  • @creative-i – Ya you are right, but I couldn’t tweak tinyMCE and din want to spend much time on that. I just wanted to make sure that those spaces wont appear in my posts, after I publish and now they dont. But am definitely looking for solution within TinyMCE itself.

    i am having a similar problem but i have isolated it to captions, seems to add blank <p> </p> before [caption and after /caption]
    this only seems to get added when switching between the html and visual editor.

    if i save the page and switch between html and visual editor it will add another, and do this as many times as i save and switch between.

    i have tried wrapping the caption with paragraph which it strips out and adds the <p> </p> before and after. when its wrapped with a div it will also add the <p> </p>

    i am using tinymce advanced and have ticked the stop removing <p> and
    setting in timymce advanced. and also tried commenting out the lines in tadv_replace.js this only removes the <br “class=spacer_” /> from <p><br “class=spacer_” /></p>

    seancon1:

    If you set tinymce to NOT strip out <p>s and such, it will put them in it seems wherever you have an image, a link to an external video and the like. Don’t ask me why it only does it when the post contains anything that isn’t plain text but it’s been like this ever since I started using WP.

    B

    After 6 months of absence from this thread I return and see nothing of significance has happened. That was a little disappointing.

    It seems that this must be a very technically challenging task – much more so than all the other bells and whistles that the WordPress developers have introduced since last it would appear. Otherwise my take is that they would have fixed this a long time ago. Surely they must be aware of it. This problem has, aside from the permalinks implementation, been the biggest downside to WordPress ever since I started using it.

    WordPress developers seem to be pretty active elsewhere on the forum so why not here? There’s this guy named Otto? Where are you Otto? Come and help us out please .-)

    uwiuw: I don’t know what I could show you really… If you are asking for a WordPress login, I’m afraid I can’t give that out to just any helpful person on the forums. These things are sensitive. For the time being, I’m placing my bet on Otto. ,-)

    Well, I tried to rectify the situation of the awful editor by trying to use Marsedit but then he ‘upgraded it’ so it won’t work on a Powerpc Mac! So I’m stuck with the non-wysiswyg version.

    EivindFS: Can it be such a difficult challenge? An editor is so basic to the Mac, but even tinymce is an add-on. Take it away and you’re left with a bare-bones editor. I don’t get it.

    I don’t get it either, Creative-i. But the fact remains that the entire WordPress community is ignoring this very serious problem. I don’t believe they can be ignorant of the problem, so they probably just don’t know how to fix it. That’s unfortunate for us. And a huge pain in the ass for our customers.

    In other threads around here, I’ve heard rumour that a different editor solution is possible being worked on.

    Not sure how high of a priority it is…. since the editor seems to be just fine for the needs of many. But I know I’ve seen talk of it

    Voodo:

    The editor works fine if it’s just text and hyperlinks to other pages but if you’re putting images, videos etc into the doc, then be prepared for a fight with the editor.

    Yes, it may well be fine for the many (though I doubt it). For me, aside from the incessant ‘massaging’ of posts that I have to go through, it’s the incredible waste of time involved. What should be a straight-ahead job turns into a fight with the editor and since 3.01 appeared another bug has been added to the editor.

    Now it can’t tell the difference between a p and a br, so now I have to remove blank lines after I’ve laid out the code in Dreamweaver correctly (I paste the raw html into Marsedit and upload to WP).

    Now some are going to tell me I shouldn’t use Dreamweaver to prepare content, but when the copy has lots of links in it, it’s the easiest way to get it ready and it works for me and has done for the past two years (I put up a lot of posts, creative-i has getting on for 6,500 posts).

    So I do hope the editor gets sorted soon.

    Maybe just a wild idea, but has anyone tried using the content_filtered_save_pre filter to strip off trailing spacers? Or is the problem more than just trailing ones?

    I’m not even sure what this is

    According to the Codex here, the content_filtered_save_pre filter filters the content before it is saved to the database. If that is indeed true, you should be able to use some pattern matching logic to remove trailing spacers.

    Is the problem only with extra trailing spacers?

    vtxyzzy:

    Yes, if you read back through this thread you’ll see a number of other problems but the spacer insert seems to be the most common problem.

    Others include not being able to add a caption to an image if it’s centered.

    And this that I mentioned above, which is a new one:

    It can’t tell the difference between a p and a br, so now I have to remove blank lines after I’ve laid out the code in Dreamweaver correctly (I paste the raw html into Marsedit and upload to WP).

    If you want to try a filter to remove trailing spacer_ lines, put this in your functions.php:

    <?php
    function content_save_pre_function ($content) {
    // A brute-force attempt to remove trailing <p><br class="spacer_" /></p> lines
    // from post text.
    $pattern = '#(<p><br class=..spacer_.. /></p>.)#m';
    $pieces = preg_split($pattern,$content,-1,PREG_SPLIT_DELIM_CAPTURE);
    if (sizeof($pieces) > 1) {
      $new_content = '';
      $drop = true;
      for ($i=sizeof($pieces) - 1;$i >= 0; --$i) {
        $piece = $pieces[$i];
        // Drop until we find a non-empty line that does not match the pattern.
        if ($drop && preg_match('#^\s*$#',$piece)) continue;
        if (!preg_match($pattern,$piece)) $drop = false;
        if ($drop) continue;
        $new_content = $piece . $new_content;
      }
      $content = $new_content;
    }
    return $content;
    
    }
    add_filter('content_save_pre','content_save_pre_function');
    ?>

    If you try it, please let me know if it works.

    Moderator James Huff

    @macmanx

    The problem is due to the fact that TinyMCE (the third-party tool) used as the Visual Editor) strips out tags that it’s not programed to understand.

    The WordPress developers are working on their own WYSIWYG editor to resolve the issue. For now, compose your post in the Visual editor, add your code in the HTML editor, and publish the post without switching back to the Visual editor.

Viewing 15 replies - 31 through 45 (of 65 total)
  • The topic ‘How come I never get an answer about WP’s awful editor?’ is closed to new replies.
Skip to toolbar