Bug 98030 - Gray highlighted non-breaking space appears when copy and pasting from web to Writer
Summary: Gray highlighted non-breaking space appears when copy and pasting from web to...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.2 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Formatting-Mark Paste
  Show dependency treegraph
 
Reported: 2016-02-20 18:39 UTC by yousifjkadom
Modified: 2018-03-20 10:23 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Copy-past from web (7.24 KB, application/zip)
2016-02-20 18:39 UTC, yousifjkadom
Details
Gray areas in originally "empty" areas (164.62 KB, image/png)
2016-02-20 18:40 UTC, yousifjkadom
Details
Brightness-1 (7.71 KB, application/zip)
2016-03-12 13:35 UTC, yousifjkadom
Details
Brightness-2 (7.77 KB, application/zip)
2016-03-12 13:36 UTC, yousifjkadom
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yousifjkadom 2016-02-20 18:39:03 UTC
Created attachment 122824 [details]
Copy-past from web

Hi. Open following link:
https://help.ubuntu.com/community/IptablesHowTo#Basic_Iptables_Options

Now open attached docx. file which represent "copy-past" from this page to LO writer docx. file. Before pasting I put docx. setting as "from left to right" with "adjustment". But after applaying "past", look how it appear as "right alignment" & "right to left direction"!

Also see the gray areas that I pointed to them by red arrows in screen shot. These gray areas can not removed unless by "delete" them.
Comment 1 yousifjkadom 2016-02-20 18:40:26 UTC
Created attachment 122826 [details]
Gray areas in originally "empty" areas
Comment 2 Buovjaga 2016-02-21 16:01:45 UTC
If you look at the source code of the page, you see:
<tt class="backtick">-m&nbsp;conntrack</tt>

&nbsp; is a non-breaking space, which you are seeing as grey. No problem.
Comment 3 yousifjkadom 2016-03-12 13:34:48 UTC
Hi. I think you are wrong because this state CREATING FATAL ERRORS. 

Look for what occured with me & my friend:

I use Linux Mint on a laptop. I have problem with brightness control. Key of brightness control have no effect. Increasing or decreasing brightness from this Fn keys not effective & brightness remain at maximum. I searched internet about solving for this issue. Look please to this site:

https://sites.google.com/site/easylinuxtipsproject/display#TOC-Another-easy-method-to-fix-the-brightness:-add-a-Grub-parameter

I copy contents to docx created by Libreoffice 5.1.1 (windows 64 version) by other laptop. I attached this file as "Brightness-1". I follow step 1 in it which including in it's final part copy/past to the terminal of linux the following:

Section "Device"
        Identifier "card0"
        Driver "intel"
        Option "Backlight" "intel_backlight"
        BusID "PCI:0:2:0"

EndSection

I used original docx. (Brightness-1) which contain the "gray areas that you called them as of no problem. I copy/past them to terminal (with all other preceeding steps are entered correctly by copy/past & have no such "gray area"). The result was disaster on re-booting. OS can not re-booting show me error message say that an error in line (file that contain text which has gray areas that can not not selected by mouse - the gray areas must including by mouse selection-).

I inforced to shutdown PC by persistant pressing on power then format it & installing Linux again.

Then I repeat same step & same way BUT I CORRECT docx 1st menualy by deleting dray area. I attached the modified file as "Brightness-2". I also copy/past text:

Section "Device"
        Identifier "card0"
        Driver "intel"
        Option "Backlight" "intel_backlight"
        BusID "PCI:0:2:0"

EndSection

which now does not contain gray areas. I re-booting normaly & brightness control achieved very well.

So, if these "gray areas" are of problem how can you explain what occured?!!

I ask my friend who suffer from the same issue to test it. He has 2 laptop with Linux with same brightness issue. He use Microsoft Office 2010 to copy site contents, then use the resultant file to copy/past to terminal. Every think O.K
He try on 2nd laptop but using copy content of site to docx. created by LibreOffice which show the gray areas. Same error occured with him. He repeat step (after format PC & reinstalling Linux) but after "deleting" these gray areas menually as in "Brightness-2. He get no error by doing this & system re-booting with brightness control achieved correctly without any error message.
Comment 4 yousifjkadom 2016-03-12 13:35:29 UTC
Created attachment 123521 [details]
Brightness-1
Comment 5 yousifjkadom 2016-03-12 13:36:00 UTC
Created attachment 123522 [details]
Brightness-2
Comment 6 Buovjaga 2016-03-12 15:06:59 UTC
The non-breaking spaces are colored gray so you would notice them.
It is unfortunate that they broke your Grub, but you should complain to the Easy Linux tips project website as they are responsible for the presentation of the Grub settings.
Comment 7 yousifjkadom 2016-03-12 16:18:08 UTC
Why I should complain to the Easy Linux tips project website ?!! Their setting is very correct !! I have to say for them "thank you very much !!"

When we (& please note "we") copy from thier site setting to terminal, there will be no any problem & it will work very fine. Also, when we copy from thier site to Microsoft Office 2010 then re-copy that from Microsoft Office 2010 to the terminal, also it will work very fine. Only when we copy from site to LibreOffice then re-copy from it to terminal, fatal error occuring. This mean - very clearly that defect is in LibreOffice because when we remove the "gray area" menualy from document that created by LibreOffice itself them copy from it to terminal, all thing will be O.K It is very clear where is the defect.

My friend test issue on his 2 laptops inspit of my warnining. He said to me that he doing so because he love LibreOffice & look for a time it will has no such defects & bugs that make him & many other like me till now we can not reject Microsoft Office completely & for ever.

Iwould like to ask: why such gray areas not appearing in Microsoft Office? Also, what the benefit from thier existance??

Please put this issue at HIGHEST PROIRITY because it mean that LibreOffice is very dangrous to copy/past from it to terminal in case of existance of such gray areas. It is very serious.
Comment 8 Buovjaga 2016-03-12 16:35:28 UTC
Please see this: https://en.wikipedia.org/wiki/Non-breaking_space

It is a mistake of the Easy Linux tips site to use such dangerous formatting! It is not a bug in LibreOffice.
Comment 9 yousifjkadom 2016-03-12 17:25:20 UTC
Hi. Thank you very much for explination. 

But I would like just to know why when I copy from site to terminal no problem will occuring ?? Foregive me, I'm not a programer. You orient me about what "Non-Breaking Space" but I do not understand why copy from site to terminal not causing error?!

Also, - for give me again since I'm not a programer -, why copy from LibreOffice to terminal associated with this error while copy from Microsoft Office not?? Is this for LibreOffice more advance & more accurate that Microsoft Office in handiling codes in such a that "common mistake" like that used by "Easy Linux tips Site" will leading to such differant behavior?

Best
Comment 10 Buovjaga 2016-03-12 17:31:13 UTC
I don't know, as I am not a programmer either.

But this is how you can avoid the problem from the start: use Ctrl-Shift-V or Paste Special and then select Unformatted text. 
he nbsp's appear only, if pasting HTML type content.
Comment 11 yousifjkadom 2016-03-12 19:40:51 UTC
By the way, what about "MIS-ALIGNMENT" ?? Who make state as "resolved". This threat of 2 elements:

1) about mis-alignment of contents: contents in web site are "left to right" alignment, but when copied to LibreOffice they appear with wrong alignment: "right to left". Isn't bug or what??

2) issue of "gray areas" or "non-breaking spaces". Even not a bug but represent real problem. I suggest on Devel. Team of LibreOffice to make a change in program in such a way it will behave, with such spaces, as Microsoft Office behave so that not occuring such disisters. 

Even if Easy Linux tips site make wrong by chosing such codes but these codes are very common. It appear that nearly all sites contents containing such spaces. At present case this reduce productivity of LibreOffice.

But even if you dont consider point (2) a problem, what about point (1)?? What about mis-alignment issue??
Comment 12 yousifjkadom 2016-03-12 19:46:06 UTC
Regarding mis-alignment, I forget to mention that I test it on version 5.1.1 (fresh release) X 64 bit on windows 7 SP1 X 64 & it is still existing without fixing so, again, whay mark this issue as "resolved"??
Comment 13 yousifjkadom 2016-03-12 19:47:44 UTC
I re-open it again. Please your fix for mis-alignment problem.
Comment 14 Yousuf Philips (jay) (retired) 2016-03-13 13:25:43 UTC
(In reply to yousifjkadom from comment #9)
> Hi. Thank you very much for explination. 

Salam Yousif,

> But I would like just to know why when I copy from site to terminal no
> problem will occuring ?? Foregive me, I'm not a programer. You orient me
> about what "Non-Breaking Space" but I do not understand why copy from site
> to terminal not causing error?!

When you copy from the webpage to the terminal, it pastes the non-breaking space as ascii character a0 which is treated similar to the regular space ascii character 20. When you paste in LibreOffice, it pastes as HTML format, and in HTML format you have non-breaking space and non-breaking space shows up with a grey background in LibreOffice. In LibreOffice if you use Edit > Paste Special and select 'Unformatted Text', it will not add non-breaking spaces to the pasted text.

> Also, - for give me again since I'm not a programer -, why copy from
> LibreOffice to terminal associated with this error while copy from Microsoft
> Office not?? Is this for LibreOffice more advance & more accurate that
> Microsoft Office in handiling codes in such a that "common mistake" like
> that used by "Easy Linux tips Site" will leading to such differant behavior?

Pasting it into Microsoft Office replaces all non-breaking spaces in HTML format with regular spaces, which is why it doesnt happen there. When copying from LibreOffice to the terminal it copies non-breaking spaces as the two character c2 a0, which is likely the cause of the problem you are facing.

@ux-advise: Should we change the behaviour of pasting in HTML format to replace non-breaking spaces with regular spaces?
Comment 15 Usama 2016-03-13 16:40:37 UTC
Hello Yousif,

Regarding the misalignment I've used the file attached and copied the text from the link you provided without any problem. I tested it on LO Version: 5.2.0.0.alpha0+ and Version: 5.0.2.2 Ubuntu 15.10.

In the feature you should file separate bug report for each issue. Combining them together would create an organizing issue, and make it harder to track.

Thank you,
Usama
Comment 16 Buovjaga 2016-03-13 17:50:39 UTC
Yousif apparently created a new report for the alignment issue: bug 98620
Comment 17 yousifjkadom 2016-03-13 19:27:07 UTC
Hi all! Thank you for your kind attantion.

But please notice that many bugs that existing in LibreOffice on windows are not existing on Linux. So, please test issue on windows OS.
Comment 18 yousifjkadom 2016-03-14 19:25:42 UTC
Dear the bug 98620 NOT RELATED to mis-alignment issue that I included in this bug 98030 Please notice that.

Here in bug 98030 issue related to copy/past from web browser (firefox) to LibreOffice on windows 7 SP1 & save in docx. or odt. (not conversion from odt. created by LO on Linux to docx. by LO on windows)

Best
Comment 19 Yousuf Philips (jay) (retired) 2016-03-15 00:51:01 UTC
(In reply to yousifjkadom from comment #18)
> Dear the bug 98620 NOT RELATED to mis-alignment issue that I included in
> this bug 98030 Please notice that.

We can only tackle one topic in a bug report, so this bug report will be about the non-breaking space. But about the mis-alignment issue, i couldnt reproduce it in Windows 7.
Comment 20 yousifjkadom 2016-03-15 11:56:32 UTC
Hi. O.K dear Yousif (jay) Philips. I will create new bug about misalignment.
Comment 21 yousifjkadom 2016-03-15 14:16:02 UTC
I created new bug 98682 about wrong alignment. Please join it
Comment 22 Robinson Tryon (qubit) 2016-08-25 05:49:16 UTC Comment hidden (obsolete)
Comment 23 yousifjkadom 2018-03-09 15:50:00 UTC
Hi. After being a Linuxer since 2 years, my education in computer is elevated to higher stage & now I become understanding that this issue represent a superior point for LibreOffice over Microsoft Office where LO show something not shown by Microsoft Office. 

In my case this cause damage to me due to my bad data (when I was a Windows user) about what these "gray highlights" mean .....

Now, I asking my self: is this really bug ?! Is it wise to make it in "New" state ?! Is it better to close it as "Notabug" ?!

Really, I do not know what I should do, because the majority of users - please correct to me if wrong - may be like me when I was Windows user (do not know what it is breaking space). This is what make me hesitated to be the man who close this "Bug(?)".

For that I descided to post this comment to "move" this issue by explaining my new opinion about it: from my side, now, I'm not further considering this as a bug, but it represent a power feature for LO give it more creadites over Microsoft Office & it is certainly useful for other users like those who use LO to create texts to be posted in a web pages .....

The decision to you to close this so called "Bug(?)" or to mentain it as it if you consider it really risky ....

Best.
Comment 24 Buovjaga 2018-03-09 17:23:37 UTC
(In reply to Yousuf Philips (jay) (retired) from comment #14)
> Pasting it into Microsoft Office replaces all non-breaking spaces in HTML
> format with regular spaces, which is why it doesnt happen there. When
> copying from LibreOffice to the terminal it copies non-breaking spaces as
> the two character c2 a0, which is likely the cause of the problem you are
> facing.
> 
> @ux-advise: Should we change the behaviour of pasting in HTML format to
> replace non-breaking spaces with regular spaces?

Well, this is still an open question. The design team should discuss it (but they naturally have their hands full with a 100 other issues).
Comment 25 Heiko Tietze 2018-03-20 10:23:46 UTC
(In reply to Yousuf Philips (jay) (retired) from comment #14)
> @ux-advise: Should we change the behaviour of pasting in HTML format to
> replace non-breaking spaces with regular spaces?

No, we should keep as much information as possible in order to be as close to the source as possible. The non-breaking spaces are easy to hide by presing ctrl+F8 (View > Field Shadings), which is the default.