Linux clipboard for text/plain contains U+00A0
Reported by
earnolma...@gmail.com,
Sep 20
|
|||||
Issue descriptionUserAgent: 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:
,
Sep 21
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...!!
,
Sep 25
,
Sep 26
Mark WontFix since Chrome should change U+00A0 to U+0020 when putting into clipboard. Note: U+00A0 comes from "<code class="bash spaces"> </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".
,
Sep 26
,
Sep 26
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.
,
Sep 27
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>
,
Oct 10
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 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.
,
Oct 10
I posted a comment here: https://bugzilla.mozilla.org/show_bug.cgi?id=359303#c44 I still think Chrome should also convert over to normal spaces when text is copied from a textarea or when text is copied from <code> elements.
,
Oct 10
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 |
|||||
Comment 1 by susan.boorgula@chromium.org
, Sep 20