Line breaks inside commit message breaks automatic issue closing

Summary

I just pushed a commit with something like Closes #12345 in the commit message, and was surprised that the issue is not closed, but shows mentioned in commit 12345678 instead.

After carefully investigating the issue, it turns out that git (or my editor, I'm not sure) inserted a line break automatically between "Closes" and the issue number for me, so GitLab just ignored it.

This is exact as described in Automatic issue closing, so strictly speaking it is not a bug. But I think this is very common (tools inserting line breaks automatically for long commit messages) that it should be supported?

Steps to reproduce

  1. Create a new GitLab repo with two issues #1 and #2.
  2. Commit to the repo, with the following commit message:
Update README.md

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris close
#1.
Nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor close #2.
  1. See the status of #1 and #2.

Example Project

zypA13510/test

What is the current bug behavior?

#1 is mentioned but not closed. #2 is closed.

What is the expected correct behavior?

#1 and #2 are both closed.