Skip to content

Posting Comment with multiple lines replaces newlines with spaces

Summary

If you comment on a ticket and your comment has newlines those are replaces with spaces or maybe they just get stripped.

Steps to reproduce

Create a comment on an issue with multiple lines. Maybe use break and not carriage return.

What is the current bug behavior?

The multiple lines get condensed to a single one, so each newline is stripped.

What is the expected correct behavior?

Preserve the newlines

Relevant logs and/or screenshots

Before Posting comment with newlines; Screen_Shot_2017-02-09_at_11.16.26_AM

After Posting comment with newlines (note it's now all on one line); Screen_Shot_2017-02-09_at_11.16.32_AM

Output of checks

I checked on Gitlab.com and this affects that site as well as our personally hosted gitlab-ce version. I'm using Chrome on Mac. Mac OS X - 10.10.5 (14F2109) Chrome - Version 56.0.2924.87 (64-bit)

Results of GitLab environment info

System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Sidekiq Version:4.2.7

GitLab information Version: 8.16.1 Revision: c6c28e6f Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://gitlab.eclipsecreative.ca:8181 HTTP Clone URL: http://gitlab.eclipsecreative.ca:8181/some-group/some-project.git SSH Clone URL: git@gitlab.eclipsecreative.ca:some-group/some-project.git Using LDAP: no Using Omniauth: no

GitLab Shell Version: 4.1.1 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/ Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Checking GitLab Shell ...

GitLab Shell version >= 4.1.1 ? ... OK (4.1.1) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 4/1 ... ok 4/2 ... ok 4/3 ... ok 4/4 ... ok 4/5 ... ok 4/6 ... ok 4/7 ... ok 5/8 ... ok 6/9 ... ok 8/12 ... ok 9/14 ... ok 11/15 ... ok 7/17 ... ok 7/18 ... ok 7/19 ... ok 12/20 ... ok 4/21 ... ok 4/22 ... ok 4/23 ... ok 4/24 ... ok 4/25 ... ok 13/26 ... ok 11/28 ... ok 14/29 ... ok 15/30 ... ok 10/31 ... ok 4/32 ... ok 16/34 ... ok 16/35 ... ok 16/36 ... ok 16/37 ... ok 16/38 ... ok 16/39 ... ok 8/40 ... ok 8/41 ... ok 8/42 ... ok 8/43 ... ok 8/44 ... ok 8/45 ... ok 17/46 ... ok 17/47 ... ok 18/48 ... ok 18/49 ... ok 19/50 ... ok 19/51 ... ok 20/52 ... ok 21/54 ... ok 8/55 ... ok 22/56 ... ok 22/57 ... ok 24/60 ... ok 24/61 ... ok 23/62 ... ok 11/63 ... ok 26/64 ... repository is empty 27/65 ... ok 8/66 ... ok 10/67 ... ok 28/68 ... ok 23/69 ... ok 29/70 ... ok 30/71 ... ok 31/72 ... ok 33/73 ... ok 16/74 ... ok 23/75 ... ok 23/76 ... ok 35/77 ... ok 23/78 ... ok 24/79 ... ok 36/80 ... ok 11/81 ... ok 37/82 ... ok 38/83 ... ok 33/84 ... ok 40/86 ... ok 39/87 ... ok 41/88 ... ok 42/89 ... ok 44/90 ... ok 42/91 ... ok 46/92 ... ok 47/93 ... ok 42/94 ... ok 48/95 ... ok 11/96 ... ok 46/97 ... ok 49/98 ... ok 42/100 ... ok 50/101 ... ok 49/102 ... ok 51/103 ... ok 4/104 ... ok 52/105 ... ok 53/106 ... ok 11/107 ... ok 55/108 ... ok 56/109 ... ok 57/111 ... ok 42/112 ... ok 58/113 ... ok 49/114 ... ok 59/115 ... ok 42/119 ... ok 60/120 ... ok 11/121 ... ok 11/123 ... ok 55/124 ... ok 49/125 ... ok 11/126 ... repository is empty 49/127 ... ok 61/128 ... ok 62/129 ... ok 11/131 ... ok 11/134 ... ok 63/135 ... ok 64/136 ... ok 66/137 ... ok 67/138 ... ok 68/139 ... ok 69/141 ... ok 70/142 ... repository is empty 71/143 ... repository is empty 66/146 ... ok 72/148 ... ok 37/150 ... ok 35/152 ... ok 73/153 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory setup correctly? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) projects have namespace: ... 4/1 ... yes 4/2 ... yes 4/3 ... yes 4/4 ... yes 4/5 ... yes 4/6 ... yes 4/7 ... yes 5/8 ... yes 6/9 ... yes 8/12 ... yes 9/14 ... yes 11/15 ... yes 7/17 ... yes 7/18 ... yes 7/19 ... yes 12/20 ... yes 4/21 ... yes 4/22 ... yes 4/23 ... yes 4/24 ... yes 4/25 ... yes 13/26 ... yes 11/28 ... yes 14/29 ... yes 15/30 ... yes 10/31 ... yes 4/32 ... yes 16/34 ... yes 16/35 ... yes 16/36 ... yes 16/37 ... yes 16/38 ... yes 16/39 ... yes 8/40 ... yes 8/41 ... yes 8/42 ... yes 8/43 ... yes 8/44 ... yes 8/45 ... yes 17/46 ... yes 17/47 ... yes 18/48 ... yes 18/49 ... yes 19/50 ... yes 19/51 ... yes 20/52 ... yes 21/54 ... yes 8/55 ... yes 22/56 ... yes 22/57 ... yes 24/60 ... yes 24/61 ... yes 23/62 ... yes 11/63 ... yes 26/64 ... yes 27/65 ... yes 8/66 ... yes 10/67 ... yes 28/68 ... yes 23/69 ... yes 29/70 ... yes 30/71 ... yes 31/72 ... yes 33/73 ... yes 16/74 ... yes 23/75 ... yes 23/76 ... yes 35/77 ... yes 23/78 ... yes 24/79 ... yes 36/80 ... yes 11/81 ... yes 37/82 ... yes 38/83 ... yes 33/84 ... yes 40/86 ... yes 39/87 ... yes 41/88 ... yes 42/89 ... yes 44/90 ... yes 42/91 ... yes 46/92 ... yes 47/93 ... yes 42/94 ... yes 48/95 ... yes 11/96 ... yes 46/97 ... yes 49/98 ... yes 42/100 ... yes 50/101 ... yes 49/102 ... yes 51/103 ... yes 4/104 ... yes 52/105 ... yes 53/106 ... yes 11/107 ... yes 55/108 ... yes 56/109 ... yes 57/111 ... yes 42/112 ... yes 58/113 ... yes 49/114 ... yes 59/115 ... yes 42/119 ... yes 60/120 ... yes 11/121 ... yes 11/123 ... yes 55/124 ... yes 49/125 ... yes 11/126 ... yes 49/127 ... yes 61/128 ... yes 62/129 ... yes 11/131 ... yes 11/134 ... yes 63/135 ... yes 64/136 ... yes 66/137 ... yes 67/138 ... yes 68/139 ... yes 69/141 ... yes 70/142 ... yes 71/143 ... yes 66/146 ... yes 72/148 ... yes 37/150 ... yes 35/152 ... yes 73/153 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.3) Your git bin path is "/opt/gitlab/embedded/bin/git" Git version >= 2.7.3 ? ... yes (2.10.2) Active users: 5

Checking GitLab ... Finished

Possible fixes

Not code savvy enough to dive into Gitlab Code, sorry.