End-line characters are ignored on Gitlab instances
Categories
(Core :: DOM: Serializers, defect)
Tracking
()
Webcompat Priority | P3 |
People
(Reporter: kumar, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Firefox for Android
Steps to reproduce:
- Open a project/snippets and select a source file (in any Gitlab instance).
- Copy some text from source file or click on copy source on clipboard (a copy sign on uppermost right side of the text editor) icon.
- Paste it in the text field.
I'd filed this bug report to Gitlab issue#62014 tracker but seems like problem is only with Firefox browser (Chromium based browser works perfectly fine). And they've confirmed this also1.
Actual results:
All endline characters are ignored and multiline text gets accumulated into a single line.
Expected results:
Text should remain as it is.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Mirko knows more about Serializer. Is this something known implementation difference between browsers?
Can confirm the behavior for current Firefox Nightly.
The difference in behavior is new to me. But as I've just started getting familiar with serialization recently, I can't exclude this is a known problem.
Note that when manually selecting and copy-pasting the text, the endline characters are kept.
It needs to be further analyzed, what exactly happens when the "Copy source to clipboard" button is clicked.
Updated•5 years ago
|
(In reply to Mirko Brodesser (PTO until 5th of August) from comment #2)
Can confirm the behavior for current Firefox Nightly.
The difference in behavior is new to me. But as I've just started getting familiar with serialization recently, I can't exclude this is a known problem.
Note that when manually selecting and copy-pasting the text, the endline characters are kept.
No, its not. Manually selecting and copy-pasting the text don't work.
It needs to be further analyzed, what exactly happens when the "Copy source to clipboard" button is clicked.
(In reply to Vipul from comment #3)
(In reply to Mirko Brodesser (PTO until 5th of August) from comment #2)
Can confirm the behavior for current Firefox Nightly.
The difference in behavior is new to me. But as I've just started getting familiar with serialization recently, I can't exclude this is a known problem.
Note that when manually selecting and copy-pasting the text, the endline characters are kept.
No, its not. Manually selecting and copy-pasting the text don't work.
On Ubuntu 18.04 with current Nightly, this works. The copied text is the following:
#!/usr/bin/env python3
def copy():
print("This is a bug")
print("Can't copy text from editor as it is")
copy()
void copy(){
printf("This is a bug");
printf("...");
}
Which OS are you using?
It needs to be further analyzed, what exactly happens when the "Copy source to clipboard" button is clicked.
(In reply to Mirko Brodesser from comment #4)
(In reply to Vipul from comment #3)
(In reply to Mirko Brodesser (PTO until 5th of August) from comment #2)
Can confirm the behavior for current Firefox Nightly.
The difference in behavior is new to me. But as I've just started getting familiar with serialization recently, I can't exclude this is a known problem.
Note that when manually selecting and copy-pasting the text, the endline characters are kept.
No, its not. Manually selecting and copy-pasting the text don't work.
On Ubuntu 18.04 with current Nightly, this works. The copied text is the following:
#!/usr/bin/env python3 def copy(): print("This is a bug") print("Can't copy text from editor as it is") copy() void copy(){ printf("This is a bug"); printf("..."); }
Which OS are you using?
Debian Stretch (9.9)
It needs to be further analyzed, what exactly happens when the "Copy source to clipboard" button is clicked.
(In reply to Mirko Brodesser from comment #4)
(In reply to Vipul from comment #3)
(In reply to Mirko Brodesser (PTO until 5th of August) from comment #2)
Can confirm the behavior for current Firefox Nightly.
The difference in behavior is new to me. But as I've just started getting familiar with serialization recently, I can't exclude this is a known problem.
Note that when manually selecting and copy-pasting the text, the endline characters are kept.
No, its not. Manually selecting and copy-pasting the text don't work.
On Ubuntu 18.04 with current Nightly, this works. The copied text is the following:
#!/usr/bin/env python3 def copy(): print("This is a bug") print("Can't copy text from editor as it is") copy() void copy(){ printf("This is a bug"); printf("..."); }
Which OS are you using?
Debian stretch (9.9).
Seems like bug has been fixed in v68.0.2 that's why you cannot reproduce it in nightly build. Manually selected text remains as it is after copy-paste in text editor.
It needs to be further analyzed, what exactly happens when the "Copy source to clipboard" button is clicked.
Seems like bug has been fixed in v68.0.2 that's why you cannot reproduce it in nightly build. Manually selected text remains as it is after copy-paste in text editor.
Still I can reproduce this bug. Don't know why, last time I couldn't reproduce this bug.
Anyway, I'm closing this issue; since this happened due to Gitlab, not FF. For more details please see these tickets, https://gitlab.com/gitlab-org/gitlab/-/issues/28819 and https://gitlab.com/gitlab-org/gitlab/-/issues/218310.
@mbrodesser, sorry for pinging directly you. I don't know anyone else to contact.
After "Kagami" investigated an issue with copying data , opened this issue. I think, this issue is more related to Firefox than Gitlab, may be similar to "copying data" issue. Problem with snippet is resolved because Gitlab developers have refactored the snippet code; and while refactoring, they may have removed part of code which was causing this issue, but issue is still reproducible on project repository, and also I've reported this on Gitlab's issue tracker. You can reproduce it by following steps:
Steps to reproduce:
- Open any project. For ex: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/repositories/base_service.rb
- Copy text from any source file. By click on Copy file Content icon, or select some text and copy it to clipboard (by pressing
ctrl+c
). - Paste it in any text editor.
Expected Output
Content of file should be as it's.
Actual Output
End of line, tab character are getting removed.
@mbrodesser, What do you think, should I reopen this issue?
(In reply to Vipul from comment #8)
@mbrodesser, sorry for pinging directly you. I don't know anyone else to contact.
After "Kagami" investigated an issue with copying data , opened this issue. I think, this issue is more related to Firefox than Gitlab, may be similar to "copying data" issue. Problem with snippet is resolved because Gitlab developers have refactored the snippet code; and while refactoring, they may have removed part of code which was causing this issue, but issue is still reproducible on project repository, and also I've reported this on Gitlab's issue tracker. You can reproduce it by following steps:
Steps to reproduce:
- Open any project. For ex: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/repositories/base_service.rb
- Copy text from any source file. By click on Copy file Content icon,
This is reproducible.
or select some text and copy it to clipboard (by pressing
ctrl+c
).
- Paste it in any text editor.
This isn't. For instance when selecting the 3rd (including) to 6th (including) line.
However, for instance when selecting all text on the page, the line breaks for the code are missing.
Expected Output
Content of file should be as it's.
Actual Output
End of line, tab character are getting removed.
@mbrodesser, What do you think, should I reopen this issue?
Yes, let's reopen it.
I've done some brief investigation to reduce to this to a smaller example but didn't succeed.
This seems to affect only the plaintext-serialization, the text/html
flavor seems to be correct (can be seen for instance by pasting to Libre Office Writer).
Reporter | ||
Comment 10•4 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) from comment #9)
This isn't. For instance when selecting the 3rd (including) to 6th (including) line.
I can only reproduce this on my default profile (which is heavily configured, using user.js file, may it's the cause of problem), neither reproducible on any other profile nor in Libre Office Writer (even for default profile which causes this problem), see screencast. May be I've changed some setting in about:config
which causes this problem in my default profile, I'll look into my profile config, later.
PS: Sorry, for earlier not testing this behavior in new profile.
Updated•3 years ago
|
Comment 11•3 years ago
|
||
The comment 9 here is relevant. Copying a few lines of code works, but copying all text makes the linebreaks inside the code disappear. So this is still valid.
Reporter | ||
Comment 12•3 years ago
|
||
Hi Schubert,
I cannot reproduce the behavior reported in comment #9 in Firefox 94.0.1 (64-bit)
on Debian GNU/Linux. For example, selecting few lines and then pressing Ctrl+c
works, similarly copying the content of the file using copy button, also works. Like snippet, Gitlab might also have refactored their codebase for repositories, upstream bug reported is already closed.
Comment 13•3 years ago
|
||
Press ctrl-a to select all text (including the entire GitLab UI), then press ctrl-c to copy all text. If you paste that, the code block will no longer have linebreaks. That's what comment 9 means with "for instance when selecting all text on the page, the line breaks for the code are missing".
Reporter | ||
Comment 14•3 years ago
|
||
Thanks, I misinterpreted the meaning of "for instance when selecting all text on the page, the line breaks for the code are missing" sentence. I thought it says selecting all code blocks miss line breaks which earlier was. But now it has been fixed, most probably because of refactoring did by Gitlab.
Updated•2 years ago
|
Description
•