Open Bug 1554489 Opened 5 years ago Updated 2 years ago

End-line characters are ignored on Gitlab instances

Categories

(Core :: DOM: Serializers, defect)

67 Branch
defect

Tracking

()

REOPENED
Webcompat Priority P3

People

(Reporter: kumar, Unassigned)

Details

Attachments

(2 files)

Attached image gitlab.gif

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.

Component: Untriaged → Serializers
Product: Firefox → Core

Mirko knows more about Serializer. Is this something known implementation difference between browsers?

Flags: needinfo?(mbrodesser)

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.

Flags: needinfo?(mbrodesser)
Priority: -- → P3

(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.

Flags: needinfo?(finn02)

(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.

Flags: needinfo?(finn02)

(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.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID

@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:

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?

Flags: needinfo?(mbrodesser)

(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:

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).

Flags: needinfo?(mbrodesser)
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Severity: normal → --
Webcompat Priority: --- → ?
Priority: P3 → --
Attached image firefox-end-line.gif

(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.

Flags: needinfo?(dschubert)

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.

Webcompat Priority: ? → P3
Flags: needinfo?(dschubert)

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.

Flags: needinfo?(dschubert)

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".

Flags: needinfo?(dschubert)

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.

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: