WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. William Bowles
    Member
    Posted 4 years ago #

    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>
  2. Chris_K
    Member
    Posted 4 years ago #

    I've been working with WordPress for 5 years now and I've never seen that.

    Are you writing your posts in some other editor and then pasting them into the WP post editor? If so, what editor -- and what happens if you delete all the blank space at the bottom of your draft before pasting it in?

  3. William Bowles
    Member
    Posted 4 years ago #

    Hi Chris,
    Couldn't login into the Forum until just now, no idea why.

    Ok, I post to Creative-i in a number of ways:

    1. Marsedit
    2. Vodpod
    3. The WP editor directly.

    The dreaded <p><br class="spacer_" /></p> gets added AFTER publishing/editing regardless of the source and what's worse there's nothing consistent about it. Sometimes it doesn't get added and sometimes it does. Sometimes it's just one but more likely it's in multiples.

    And yes, I always make sure the text is 'clean' before uploading or publishing. It's only been happening since 2.9x. I now always view the post in WSIWYG and source but it's a drag as it triples the time involved in publishing as I have to check again and again to make sure it hasn't crept in again.

    BTW, I'm running on OSX 10.5.8 and using Firefox 3.5.7

    I can get the Server profile if you need it.

    Bill

  4. Chris_K
    Member
    Posted 4 years ago #

    OK, if it gets added after publishing then I'd wonder about plugins. Are you running any translation plugins by chance? I did a google search on br class="spacer" and found some links that might be relevant.

    So that's where I'd start -- disable plugins and do some testing by enabling them one by one while creating test posts after each enable. Tedious, I know, but that may be the best way to narrow it down.

  5. William Bowles
    Member
    Posted 4 years ago #

    Hi Chris,
    Yes, two, but one (Convey it) has been running pretty much ever since I launched Creative-i in 2008 without any problems. The other, the Google Widget has been installed for about 3 months.

    Tedious is not the word I'd use, but yes I'll have to bite the bullet...

    Thanks

    Bill

    http://www.creative-i.info

  6. schmitty23
    Member
    Posted 4 years ago #

    I have the same issue. I don't use any translator plugins. I do use the TinyMCE Advanced editor. Same thing seems to happen to me ... I edit a page in wysiwyg mode and those damn spacers get added.

    I really wish WP would fix the editor to make it not mess with certain things like this, line breaks, etc.

  7. nswdoug
    Member
    Posted 4 years ago #

    I have the same issue, I did some searching and some info suggests a conflict with tinyMCE advanced, although I already have ticked the setting that supposedly stops removing the <p> and br/ tags.

    The issues only occurs intermittantly which is really frustrating.

  8. Aeox
    Member
    Posted 4 years ago #

    Hey guys, i got the same problem. The Problem is TinyMCE Advanced Module and it occurs when you enable this option in the settings of the TinyMCE Advanced Module:
    Stop removing the < p > and < / br > tags when saving and show them in the HTML editor
    Disable this, and it no longer will generate the strange
    <p><br class="spacer_" /></p> Lines.
    I guess its a bug and need to be fixed.
    Hope this helps, it worked for me.

  9. William Bowles
    Member
    Posted 4 years ago #

    I'll try it but for me it creates another problem namely I need the </p><p>s when I copy some posts in source mode to another site, meaning I have to put the damn things back in!

    Bill

  10. RipRapRob
    Member
    Posted 4 years ago #

    Thanks for this - I had the same problem, and it was driving me nuts.

    To me it looks like a silly bug, either in TinyMCE Advanced or the way it intergrates with WordPress.

    Instead of "Stop removing the < p > and < / br > tags when saving" it should have a "Stop adding < p > and < / br > tags when viewing".

    Anyhow; Thanks again :-)

  11. EivindFS
    Member
    Posted 4 years ago #

    I too have this problem and it's a huge problem. My clients don't understand anything when this stuff happens. Of course not - it shouldn't happen.

    This needs to be fixed ASAP. It has been overlooked for years.

    Eivind

  12. uwiuw
    Member
    Posted 4 years ago #

    @EivindFS

    can you give the link ?

  13. FalconsFan
    Member
    Posted 4 years ago #

    I'm having the same problem but I believe I found a work around. I don't know what all this will affect but it does appear to resolve the problem.

    I've edited plugins/tinymce-advanced/js/tadv_replace.js as by commenting out the following lines (basically any reference to paragraph tags) :

    pre_format : function(c) {
    
    		c = c.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
    			a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
    			return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
            });
    
    		/*
    		c = c.replace(/<p>(\s|<br ?\/?>|\u00a0)*<\/p>/g, '<p><br class="spacer_" /></p>'); // keep empty paragraphs...
    		*/
            c = c.replace(/\[\/sourcecode\]\s*<br \/>\s*<br \/>/g, '[/sourcecode]\n');
    		/*
    		c = c.replace(/<p( [^>]*)?>/g, '\n<p$1>');
    		c = c.replace(/<\/p>/g, '</p>\n');
    		c = c.replace(/<\/p>\s*<p/g, '</p>\n\n<p');
    		*/
    		c = c.replace(/<((blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])[^>]*)>\s*<p/g, '<$1><p');
    		c = c.replace(/<\/p>\s*<\/(blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])>/g, '</p></$1>');
    		c = c.replace(/<br ?\/?>[\r\n]*/g, '<br />\n');
    		c = c.replace(/<li([^>]*)>/g, '\t<li$1>');
    		c = c.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
    		c = c.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
    
    		c = c.replace(/<object[\s\S]+?<\/object>/g, function(a) {
    			return a.replace(/[\r\n]*/g, '');
            });
    
    		return tinymce.trim(c);
    	},
  14. FalconsFan
    Member
    Posted 4 years ago #

    Sorry folks, I thought that resolved the issue but I just noticed that it is still doing it.

    Everytime I save the page it adds a new <p></p>, very irritating.

  15. FalconsFan
    Member
    Posted 4 years ago #

    I just noticed that if I have an image or text that is not wrapped in in a paragraph tag, that is when it continually inserts the unwanted tags.

    The page that I noticed this happening on had text inside a table cell but was not using paragraph tags, when I put the text inside p and /p tags the issue went away.

  16. William Bowles
    Member
    Posted 4 years ago #

    I think it has something to do when you have <div> tags and <span> tags in the same doc, something that's not always under your control. It seems that WP (in it's wisdom or is it Tinymce?) decides that you don't really want a space between lines so it just knocks it out, the opposite of the original problem.

    The WP editor works fine if it's just text and few links, anything else seems to throw it for a loop. It's frustrating and so basic to blogging that I can't understand why it's such a longstanding issue.

    Bill

  17. William Bowles
    Member
    Posted 4 years ago #

    Ok, I've inserted the code but what happens to the output?

  18. FalconsFan
    Member
    Posted 4 years ago #

    If you comment out the sections of code I noted above and make sure that all text is contained in a paragraph tag (which is valid html anyway) then the editor works perfect, at least it has for me.

    It stops adding additional paragraph tags and leaves the code as you enter it. So if you add additional blank lines and you have the option checked to stop removing those tags, then they are left in AND you don't get the annoying extra tags that it had been inserting every time you save.

  19. demonboy
    Member
    Posted 4 years ago #

    For someone who runs an image-intensive blog whilst traveling around the world using slow connections in internet cafes, this bug is THE MOST ANNOYING aspect of WP. It is seriously driving me nuts.

    Please, I beg Andrew Ozz the developer, or anyone else with the know-how to please, please, please take a look at this problem. Please!

    Thank you!

  20. cjraven
    Member
    Posted 4 years ago #

    For what it's worth - I second this complaint.

    I've tried enabling/disabling the <p> + </ br> option in TinyMCE settings page, and just for yucks 'n giggles tried FalconsFan code mod.

    Sadly neither produced the desired result.

    Oh dear, I do wish this could be fixed, it's madly annoying.

  21. demonboy
    Member
    Posted 4 years ago #

    I too tried FalconsFan's code to no avail. I just can't emphasize enough how frustrating this bug is, especially on my crappy GPRS connection here in India. Imagine every time I save a draft a few new blank paragraphs are added to my post. I then have to go through and delete them all, only to have new, different random paragraphs added when I try to save my amended version. It is ruining my productivity and costing me hours of wasted editing time.

  22. Christine
    Member
    Posted 4 years ago #

    Tiny MCE Advanced plugin has an option in its settings: Stop removing the <p> and
    tags when saving and show them in the HTML editor
    works for me

  23. aizatto
    Member
    Posted 4 years ago #

    I've got somewhere with this.

    2 files need to be changed.

    • Open /wp-includes/formatting.php
    • Go to function wp_richedit_pre.
    • Replace it with:
      function wp_richedit_pre($text) {
      	// Filtering a blank results in an annoying <br />\n
      	if ( empty($text) ) return apply_filters('richedit_pre', '');
      
      	$output = convert_chars($text);
      	$output = wpautop($output);
      	$output = shortcode_unautop($output);
      	$output = htmlspecialchars($output, ENT_NOQUOTES);
      
      	return apply_filters('richedit_pre', $output);
      }
    • Open /wp-content/plugins/tinymce-advanced/tinymce-advanced.php
    • Go to function function tadv_htmledit.
    • Replace it with:
      function tadv_htmledit($c) {
      		$tadv_options = get_option('tadv_options', array());
      
      		if ( isset($tadv_options['fix_autop']) && $tadv_options['fix_autop'] == 1 ) {
      			$c = str_replace( array('&', '<', '>'), array('&', '<', '>'), $c );
      			$c = wpautop($c);
      			$c = shortcode_unautop($c);
      			$c = htmlspecialchars($c, ENT_NOQUOTES);
      		}
      		return $c;
      	}

    I hope that solves the problem for you!

  24. William Bowles
    Member
    Posted 4 years ago #

    Hmmm, so to get a decent editor I have to hack code? I think not.

    I still find it amazing that a piece of software that reputedly has a million users, something so fundamental to publishing as its editor is so awful but above all time-consuming.

    Things like for example:

    I include an image and want to add a caption to the image but ONLY if it's NOT centred or if the image is a link, then I can paste the caption in til hell freezes over but no go.

    I really feel the whizzkids, rather than yet more 'bells and whistles' need to address the fundamentals first, but then perhaps they don't write?

    And why do we have to rely on the TinyMCE plugin, surely building the editor at source is preferable?

    Bill

  25. Darrell Schauss
    Member
    Posted 4 years ago #

    TinyMCE Advanced, using tables is horrible. I have to hit backspace to delete invisible spaces (text cursor doesnt move to delete any visible space) before saving or I get extra spacing. If I even open the page and change any portion I have to remember to tediously click that area and hit backspace.

  26. tamerax
    Member
    Posted 4 years ago #

    just wanted to say that i did those simple code hacks listed above and everything is working much better :) thanks!

  27. demonboy
    Member
    Posted 3 years ago #

    Has anyone implemented aizatto's work-around, above, and then found that certain Ajax functions are no longer working with WP 3.0 (specifically custom fields and replying to comments)?

    Also sometimes when I edit a post in Visual mode, the body text displays HTML code.

    Basically aizatto's solution worked for me but may have caused other problems. Also I'm not happy about messing around with anything in wp-includes folder. Mods have previously seriously warned against solutions like this.

  28. tpgreenwood
    Member
    Posted 3 years ago #

    We have a site with this problem and it's really driving me nuts. Normally we don't need to use TinyMCE Advanced, or at least can let it remove <p> tags without any problem.

    However, we have one site where we need to put a lot of anchors on pages. TinyMCE advanced is great for that, but WP keeps editing the format of our anchor tags to a format that doesn't work in IE.

    Only solution we've found is to tick the box 'do not remove <p> etc', but this causes the same prolem as above now that we've upgraded to WP3.0. It keeps adding the following in the page code:

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

    It seems to happen when you edit in visual mode, particularly on posts with captions on images.

    Is there any solution to this that doesn't involve hacking code?

  29. William Bowles
    Member
    Posted 3 years ago #

    Yes, the <p><br class="spacer_" /></p> seems only to affect posts that contain images or videos. It seems tinymce can't handle these properly. The worst thing about it is the time spent going back and editing the damn thing often over and over again to remove the unwanted blank lines.

    On the other hand if you want to ADD a blank line, tinymce will strip them OUT!

  30. rajivvishwa
    Member
    Posted 3 years ago #

    Did someone try this out?
    wordpresstips.googlethem.com/paragraph-spaces-in-wordpress-editor-how-to-make-space-between-paragraphs/

Topic Closed

This topic has been closed to new replies.

About this Topic