Ask Your Question

Gray background between words when paste content in Writer

asked 2018-01-20 16:31:14 +0200

Alex.75 gravatar image

updated 2018-01-20 16:34:10 +0200


when I paste some content in a Writer document it creates often an empty spaces with a gray background between words.
I just copied a piece of text from a website, this:

image description

and pasted it in a Writer document:

image description

Why there is that gray background for the space between two words ?

Libre Office version: as I know this problem is ever existed.

If you think this is a little problem... it is not. I have sometime documents whit HUNDREDS of gray squares like that.

The web page of my example is this:

The HTML of that paragraph in the web pase is this: image description


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2018-01-20 17:10:33 +0200

Platterbaff gravatar image

The only cause I know of is that LO is showing you the space is a “non-breaking” one, so that two words will be kept together when word-wrapping takes place. See page 79 of the Writer 4.2 PDF manual.

The gray mark will not be printed. You can stop it showing on-screen by selecting “Tools”>”Options”>”LibreOffice Writer”>”Formatting aids” and removing the tick fom the “Non-breaking spaces” box. But I do not recommend this – the mark helps show up the source of problems when text is copied from websites etc.

edit flag offensive delete link more


Why LiberOffice is doing this? Do you have a reasonable explanation for this behavior?
Where can I find the Writer PDF manual ?
I haven't found that document. I honestly have no idea of what is the meaning of "Formatting Aid" and there is not a single line of explanation in that window. Anyway unchecking the "Non-breaking space" checkbox is the solution for this problem.

Thank you.


Alex.75 gravatar imageAlex.75 ( 2018-01-21 02:09:53 +0200 )edit

You can download the PDF manual from the Get Help/Documentation Page. The manuals are still catching up with LO 5, so you you should find the Writer manual under “4.x guides”. But you might want to download the “Getting Started” manual as well. This does have an LO 5 edition.

Platterbaff gravatar imagePlatterbaff ( 2018-01-21 12:34:13 +0200 )edit

Like any other well-behaved word-processor LO gives you the choice of seeing where a formatting aid is doing something something behind the scenes. The non-breaking space will be there because the author put it there. I prefer to see that it is there because copied text often has this connection where I might might not want it. But the choice is yours.

Platterbaff gravatar imagePlatterbaff ( 2018-01-21 12:34:49 +0200 )edit

I disagree with you a little. Let me explain.
Other word processor (MS Word) just fill the copied text in the document, without the fancy "gray squares". That is what probably 99.9% of the users want.
A well-behaved word-processor should provide the functionality to enable the visibility/highlight of that NBSP but that should not be enabled by default in my opinion.
My point is that this nice advanced feature should not be an "issue" for common users. But is nice to have.

Alex.75 gravatar imageAlex.75 ( 2018-01-21 14:34:05 +0200 )edit

The author (the original HTML document) does not have set any NBSP before that link. It has a simple space and can go on new line if required.
LO formatting aid put the NBSP also after the HTML anchor. I think it is converting the new-line character in paragraph to NBSP. Its reasonable but it can results in a "dirty" document sometime (there many NBSB everywhere, often non-sense).
I really appreciate your explanation. Thank you.

Alex.75 gravatar imageAlex.75 ( 2018-01-21 14:49:10 +0200 )edit

answered 2018-01-20 17:20:27 +0200

Grantler gravatar image

updated 2018-01-20 17:24:35 +0200

Your "empty space with a gray background" is a so called non-breaking space. HTML generators use this method to avoid problems with regular spaces. For example if you type 5 spaces like here between the X characters:


the space between is shown as only one space. If you put in 5 non-breaking spaces the distance remains as wished:

X     X

You easily can see the difference. For some reasons it is useful to use non-breaking spaces in word editing. If you have got a sum of "23 kg" at the end of a line the non-breaking space defeats the separation into two words...

You can insert the non-breaking space using Insert menu > Formatting mark in your texts.

It is possible to replace the non-breaking spaces by using Find And Replace tool. Copy or cut one of the non-breaking spaces into the search line and hit a space in the replace line and replace "all", so all of the mentioned non-breaking spaces can be eliminated.

edit flag offensive delete link more


I don't understand. The HTML code is this: < p >If you want to use the advanced javascript integration, you will need a way to create payment tokens on your server side. The simplest way to do this is using the < a href="" >PayPal Payments REST API< /a >< /p >

There is no need for "non breaking space", there are no " " at all in the HTML. 1. Who is adding the non-breaking spaces?
2. Why non breaking spaces are set with that useless bg?

Alex.75 gravatar imageAlex.75 ( 2018-01-21 01:30:07 +0200 )edit

I understood now the use of non-breaking spaces here. I think that LiberOffice is arbitrary deciding that there is the NEED of a nbsp before an HTML anchor element (and probably other HTML elements). The result is, in my opinion, a bad UX for 99% of the users. The expert user that want use the NBSP is able to add nbsp whenever they want. A common user just have to remove that "strange" gray background manually because a common user doesn't not know how to do it differently. Thank you for the pre

Alex.75 gravatar imageAlex.75 ( 2018-01-21 02:21:39 +0200 )edit
Login/Signup to Answer

Question Tools



Asked: 2018-01-20 16:31:14 +0200

Seen: 404 times

Last updated: Jan 20 '18