There’s already a PR about that specific issue
https://github.com/discourse/discourse/pull/6510
Needs some more work though.