Newlines in custom server hook error messages render improperly in merge UI
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=284640) </details> <!--IssueSummary end--> ### Summary Newlines in custom system hook error messages do not render correctly in the merge request UI on attempted merge. ### Steps to reproduce Create a new repository with an empty `README.md`. Create a new branch within that repository with some arbitrary content and submit a merge request. Then create a custom hook within the given repository with a multiple messages, as follows: ``` #!/bin/sh echo "GL-HOOK-ERR: User is ${GL_ID}" echo "GL-HOOK-ERR: Do better." exit 1 ``` Finally attempt to merge that MR. ### What is the current *bug* behavior? Newlines are replaced and rendered as literal `<br>` but *not* rendered as html (so are displayed literally). ### What is the expected *correct* behavior? Messages should be displayed on separate lines, as appropriate. ### Relevant logs and/or screenshots The problem: ![ui-merge-pre-receive](/uploads/c50a957b959c3f577fd06ccb1a554145/ui-merge-pre-receive.png) How it should (and does display in the edit/commit UI): ![ui-edit-pre-receive](/uploads/2f85d914d61945ceccf86c3d81dbcc3c/ui-edit-pre-receive.png) ### Possible fixes Relevant bit of code, but not necessarily where to fix this: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/utils.rb#L94
issue