errant non-breaking spaces are breaking my page!

  • Unknown's avatar

    In a recent post, the block editor has automatically added a ridiculous amount of non-breaking spaces to my copy. Half of the spaces have been replaced by &nbsp’s! This seems to be having the side-effect of completely breaking my page, as I can see it in the editor view and when logged in, but to the general public the page is completely blank! I have started going through the page in the HTML editor, but it will take forever to remove all the &nbsp’s, especially as I can only go one block at-a-time. I have tried editing in classic view, but that breaks everything too. How can I fix this page? (and ensure this does not happen again?)

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    This usually happens when you copy text from another program (Word, …) or platform.

  • Unknown's avatar

    Yes, the page text was copied/pasted from Word.

    I’ve discovered that I can view and edit the whole page as HTML. I was able to copy all the HTML into a text editor, find and replace all the non-breaking spaces with regular spaces.

    However, the page is still ‘broken’ i.e. something is preventing from showing any more than the title.

    Here’s a link to the page: https://euanritchie.org/2023/08/08/letter-to-victorian-ministers-public-policy-in-victoria-regarding-dingoes/

    Any input greatly appreciated :-)

  • Unknown's avatar

    Word and similar programs produce very sloppy and heavy html. I suggest you copy everything into a simple texteditor, this will remove all html from Word. Next copy everything back into WordPress.

  • Unknown's avatar

    Thanks @staartmees I’m well aware of Word’s junk HTML, but this is not what it is. This is specifically a lot of non-breaking space characters being put in by the block editor. The classic editor does not do this.

    I haven’t had any success is resolving the issue of this post. So I started from scratch, building the post first in the classic editor, then converting to blocks, then applying a few block-specific styles for things like the 2-columnn layout. It really should not be this hard.

  • Unknown's avatar

    Hi there!

    I noticed that your post has the newsletter visibility set to anyone subscribed. This prevents the post from being viewed by visitors on the web who aren’t logged in and subscribed to your site. I know this isn’t what you posted about, but I wanted to point this out just in case. :)

    Regarding the formatting, please let us know if you run into the issue again. As you know, a lot of junk code gets copied when you copy from word processing software. We can look into the code to see what exactly is causing an issue.

    Since you already re-did the post from scratch, please share the link to any future post where you only see the title and none of the content.

    Thanks!

  • Unknown's avatar

    Thanks @aisajib. Oh, I did that so subscribers wouldn’t be notified while I was testing the new post. Maybe that was the wrong idea. I didn’t realise that meant it was subscriber-only content.

    I’ve now deleted the ‘broken’ post. The active working post is https://euanritchie.org/2023/08/08/letter-to-victorian-ministers-public-policy-in-victoria-regarding-dingoes-2/

  • Unknown's avatar

    @stonenickI I’m running into this today on a new post of one of the 100s of self-hosted WP sites I built and manage — client says they copy/pasted from a PDF but similar to how they usually do (and the block editor tends to do a great job of removing rogue HTML). They did say this particular post had been hanging out in their drafts fro like 6 months – maybe thats a relvant variable?

    NBSpace characters get added back in even if I delete a paragraph block and re-paste in clean from an HTML editor. WILD. Creating very arbitrary line breaks in the INGREDIENTS section here, and causing sentences to not wrap at all on mobile. https://katieparla.com/recipe-pasta-con-pesto-di-pistacchi-pistachio-pesto-pasta/

    Will probably just have to rebuild the post but wondering if you learned anything new or if the Drafts thing was also true when you experienced it?

  • @mattea47b1c2b33 – I see what you mean. I checked several of the posts I’ve written in the past few days and I don’t see any errant non-breaking spaces in them, but the fact that two people are seeing this issue does raise concern.

    I’m sharing an HTML snippet of what I saw:

    <p>Bring&nbsp;a&nbsp;large&nbsp;pot&nbsp;of&nbsp;water&nbsp;to&nbsp;a&nbsp;rolling&nbsp;boil&nbsp;over&nbsp;high&nbsp;heat.</p>

    If they paste as plain text, do they see the same issue? And @stonenick – were you able to paste as plain text?

  • Actually @mattea47b1c2b33, I just realized this is an older thread. But if your clients are using our Calypso interface (usually starting at wordpress.com/post) and they’re getting all the extra spaces from that, could you please create a new post here, and tag it with Modlook so staff can take a look?

    If they’re using wp-admin, I’d recommend posting over in the forums for WordPress.org instead, as others may be seeing the same thing. It sounds like an aggravating bug, so hopefully one of our communities can get to the bottom of it.

  • The topic ‘errant non-breaking spaces are breaking my page!’ is closed to new replies.