Skip to content

Bug: Switching Between Rich Text and Plain Text Editors Adds Extra Blank Lines After Comments

Summary

The customer is experiencing an issue where toggling between rich text and plain text editing modes in GitLab issue descriptions causes extra blank lines to be inserted after comments within code blocks. Each toggle adds additional blank lines, progressively degrading the code formatting. This is particularly problematic when they frequently document C++ code in the issues, and the comments are an integral part of the code examples.

  1. Create a new GitLab issue
  2. Switch to rich text editing mode
  3. Add the following text in the description:
var test1 10
// testing comment
test 1
test 2
test 3
  1. Switch back to plain text editing mode
  2. Observe that GitLab has added blank lines after the comment

Expected Behavior

The code block should remain unchanged when switching between editing modes. The formatting should be preserved exactly as entered:

var test1 10
// testing comment
test 1
test 2
test 3

Actual Behavior

After switching to plain text editing, extra blank lines appear after the comment:

var test1 10
// testing comment


test 1
test 2
test 3

Note: Each subsequent toggle between rich text and plain text modes adds more blank lines, compounding the issue.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

 (For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:env:info\`)  (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\`)  

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`)

(For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)

(we will only investigate if the tests are passing)

Possible fixes

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited by David Wainaina