New issue
Advanced search Search tips

Issue 887511 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 26
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Linux clipboard for text/plain contains U+00A0

Reported by earnolma...@gmail.com, Sep 20

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Steps to reproduce the problem:
1. On Linux, copy the bash script code from https://hoodlogic.tk/pre_bash_nbsp.html
2. Save the code in a file locally called test.sh
3. bash test.sh (you'll get 'syntax error near unexpected token `then`' error message when you shouldn't)

Full description of issue here:
https://stackoverflow.com/questions/51794845/pre-html-nbsp-m-bm-bash-scripts-syntax-highlighting-on-the-web-remove-asc

What is the expected behavior?
  should be converted to Linux space character instead of being kept as non-breaking space in ASCII.

The latest version of Firefox (62.0) on Linux appears to handle this properly, but it didn't until recently...

Chrome still handles this incorrectly.

https://stackoverflow.com/questions/51794845/pre-html-nbsp-m-bm-bash-scripts-syntax-highlighting-on-the-web-remove-asc

What went wrong?
https://stackoverflow.com/questions/51794845/pre-html-nbsp-m-bm-bash-scripts-syntax-highlighting-on-the-web-remove-asc

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 69.0.3497.100  Channel: stable
OS Version: Ubuntu 16.04
Flash Version:
 
Labels: Needs-Triage-M69
Components: Blink>HTML>Script
Labels: Triaged-ET TE-NeedsTriageHelp
The issue seems to be out of TE-scope as it is related to bash script code. Hence, adding label TE-NeedsTriageHelp for further investigation from dev team.

Thanks...!!
Components: -Blink>HTML>Script Blink>Editing
Components: -Blink>Editing Blink>Editing>Serialization
Status: WontFix (was: Unconfirmed)
Mark WontFix since Chrome should change U+00A0 to U+0020 when putting into clipboard.

Note: U+00A0 comes from
"<code class="bash spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code>"

Note: Windows OS converts U+00A0 to U+0020 for "text/plain" even if Chrome puts U+00A0 into clipboard. Windows OS keeps U+00A0 for "text/html".


Summary: Linux clipboard for text/plain contains U+00A0 (was: pre html - &nbsp; M-BM- bash scripts syntax highlighting on the web - remove ASCII representation of byte sequence 0xc2 0xa0)
So you're saying it works as intended?  I'm a bit confused.  When I copy that bash script in Chrome on Linux, it doesn't work the way it should when I execute the bash script. 
Sorry for confusion. I said from Chrome's point of view putting U+00A0 into clipboard is correct and expected. In other words, this is plug-in issue instead of Chrome.

Please ask plug-in author not to use U+00A0 to make indentation.
Once plug-in use "white-space: pre" style with U+0020, you can get U+0020 in clipboard, e.g.

<style>
...
.spaces { white-space: pre }
...
</style>

<code class="bash spaces">    </code>

Thanks, would you say this is a proper summary of the syntax highlighting script issue?

https://stackoverflow.com/questions/51794845/pre-html-nbsp-m-bm-bash-scripts-syntax-highlighting-on-the-web-remove-asc/#answer-52744644

It looks like Firefox converts &nbsp; automatically.  Chrome should too?  There's a bug report with Mozilla (https://bugzilla.mozilla.org/show_bug.cgi?id=359303) asking for it to not behave like that, but I'm going to argue that it should behave like this.
I posted a comment here:

https://bugzilla.mozilla.org/show_bug.cgi?id=359303#c44

I still think Chrome should also convert &nbsp; over to normal spaces when text is copied from a textarea or when text is copied from <code> elements.
Seems to be a locale language thing (as mentioned in the Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=359303), so I guess Chrome does handle this correctly.


Sign in to add a comment