WordPress.org

Forums

How come I never get an answer about WP's awful editor? (66 posts)

  1. William Bowles
    Member
    Posted 4 years ago #

    rajivvishwa:

    I checked out the tip and it means that you have to switch between source and wysiwyg and I've noticed that when you switch between the modes and do a save, tinymce puts the spacer code back in again.

    Even if it does work (I've not tried it yet), it's a very clumsy solution.

    Far better to modify the appropriate tinymce code.

    B

  2. rajivvishwa
    Member
    Posted 4 years ago #

    @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.

  3. seancon1
    Member
    Posted 4 years ago #

    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>

  4. William Bowles
    Member
    Posted 4 years ago #

    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

  5. EivindFS
    Member
    Posted 4 years ago #

    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 .-)

  6. EivindFS
    Member
    Posted 4 years ago #

    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. ,-)

  7. William Bowles
    Member
    Posted 4 years ago #

    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.

  8. EivindFS
    Member
    Posted 4 years ago #

    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.

  9. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    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

  10. William Bowles
    Member
    Posted 4 years ago #

    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.

  11. vtxyzzy
    Member
    Posted 4 years ago #

    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?

  12. William Bowles
    Member
    Posted 4 years ago #

    I'm not even sure what this is

  13. vtxyzzy
    Member
    Posted 4 years ago #

    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?

  14. William Bowles
    Member
    Posted 4 years ago #

    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).

  15. vtxyzzy
    Member
    Posted 4 years ago #

    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.

  16. 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.

  17. William Bowles
    Member
    Posted 4 years ago #

    James:

    Yes, I know what the problem is but it's not just the stripping out and adding in that's a problem, as I've highlighted above somewhere. But what you suggest is just as time-consuming.

    vtxyzzy:

    I'm not au fait with php code but I'll try it. Does it get added anywhere or what?

  18. William Bowles
    Member
    Posted 4 years ago #

    PS to James:

    You wanted to know what other problems the editor has, well here's yet another one. Sometimes when I alter the setting on an image eg, from centered to left, the editor doesn't accept the change. Yet again, I have to go into source mode, delete the offending code, go back to visual and reselect the image and change the settings (again).

    You wonder why I get so infuriated with the editor?

  19. EivindFS
    Member
    Posted 4 years ago #

    I'm not sure this was already mentioned, but one of my big frustrations with the WordPress editor is that something as simple as separating one paragraph into two can be too much for this little editor. I put the cursor in the paragraph, press enter. Everything is fine. But then I switch between modes and all of a sudden I see that the two paragraphs have been merged into one.

    The editor is seriously lacking and I do agree with Creative-i that it's really surreal that so many users have accepted this editor for so long and making so little noise about it.

    I look forward to seeing the updated editor. A lot! :-)

    E

  20. Samuel B
    moderator
    Posted 4 years ago #

  21. William Bowles
    Member
    Posted 4 years ago #

    Ok, I see that it's only tested up to 2.8.4? Have you tried it?

  22. chanel
    Member
    Posted 4 years ago #

    I thought I was the only one going through this issue for the past year and blamed it on my Firefox. Sad to see that this was posted over 8 months ago, with so much comment activity, and no solution or response from an actual WP developer.

  23. Samuel B
    moderator
    Posted 4 years ago #

    Ok, I see that it's only tested up to 2.8.4? Have you tried it?

    I use it on all my sites

  24. William Bowles
    Member
    Posted 4 years ago #

    Okay, installed it and it seems to be rather neat. Edited a couple of pieces and the output varied not by one pixel. But how come I didn't know about this editor before?

    Thanks

    B

  25. William Bowles
    Member
    Posted 4 years ago #

    Some feedback on the editor:

    I mostly use Marsedit to send texts to WP and so far it's worked pretty well, with a couple of small exceptions.

    But using the fckeditor (was the author pissed off with WP's editor?) when I come to edit the uploaded texts, the editor is not putting returns into the text, so it's all one big para. It's okay in source mode but difficult to read.

    I took the text and HTMLed it, re-uploaded it and it looks fine in the fckeditor.

    BTW, I assume Marsedit adds <p>'s to the text though if it has actual returns instead of html, it always looks ok in the WP editor.

  26. Purushottam kumar sinha
    Member
    Posted 4 years ago #

    In "tinymce-advanced/js/tadv_replace.js" : Line No. 54
    Replace
    c = c.replace(/<p>(\s|<br ?\/?>|\u00a0)*<\/p>/g, '<p><br class="spacer_" /></p>');
    with
    c = c.replace(/<p>(\s|<br ?\/?>|\u00a0)*<\/p>/g, '');

  27. William Bowles
    Member
    Posted 4 years ago #

    purusinha:

    I'll try it out.

    Bill

  28. William Bowles
    Member
    Posted 4 years ago #

    Samuel B:

    Re the fckeditor: I had to drop it as it made editing texts almost impossible. Back tinymce...

  29. vtxyzzy
    Member
    Posted 4 years ago #

    I used to recommend the fckeditor, but also had to drop it. Reported the problem here.

  30. DirkD
    Member
    Posted 4 years ago #

    While recreating my old WP site, I too became extremely frustrated with the terrible spacer line. Can't believe that this problem is still here.

    However, I just tried the solution that purusinha posted above and it seems to work fine! I can edit and reedit my posts and they stay clean. Keep my fingers crossed and still waiting for the new WP editor.

Topic Closed

This topic has been closed to new replies.

About this Topic