Line breaks in Git Hook errors not rendered

Zendesk ticket (internal link): https://gitlab.zendesk.com/agent/tickets/97650

The above customer has set up a custom hook with the following error:

    print("Commit message does not include at least one of these required tags:\n"
        "Feature: \n"
        "Fix: \n"
        "Breaking: \n", file=sys.stderr)

When the hook fails, the error message is displayed with the line breaks rendered. For example, the following is displayed:

Commit message does not include at least one of these required tags:<br>Feature:<br>Fix:<br>Breaking:<br>...

As you can see, GitLab converted the \n chars into <br> line breaks, but doesn't actually render them. This looks like a bug.

Please see the above mentioned ticket for images. The customer is running GitLab 10.7.3-ee.

Edited Oct 02, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading