inline code is incorrectly wrapped across lines in merge request descriptions

Summary

Inserted code in the description of a merge request is not consistently wrapped correctly when the width of the browser window is changed, or when the browser window is effectively at maximum width.

Below is a video demonstrating this.

Steps to reproduce

  1. Open a MR with backticked insert code blocks in the description, containing long words or strings.
  2. Adjust the width of the window and observe how the description of the MR is rendered and the text wrapped.

Example Project

What is the current bug behavior?

single strings inserted as code-in-the-description gets split across lines

What is the expected correct behavior?

as far as is practical, a string inserted-as-code will get rendered on its own line, not split across lines.

Relevant logs and/or screenshots

see: !201343 (closed)

image

image

Screencast_from_2025-08-13_16-58-18

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 Ben Prescott (ex-GitLab)