The file editor includes all spaces when creating files

Problem

When creating a new file through the single file editor, it's far too easy to create a file with a rogue space at the end:

Screenshot_from_2020-06-04_13-36-43

I confirm the rogue space here:

Screenshot_from_2020-06-04_13-38-53

And when that file is used in www-gitlab-com CI jobs, specifically for the Release post, it leads to difficult to diagnose errors, ref https://gitlab.com/gitlab-com/www-gitlab-com/-/jobs/582043684#L74. Problem diagnosed with @fseifoddini .

How to replicate

Follow the documentation here: https://docs.gitlab.com/ee/user/project/repository/web_editor.html

  1. Create a new branch: https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-new-branch
  2. Create a new file: https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file
    1. Make sure to add a space at the end, per the screenshot above

Suggested solution:

Update the code to "strip off" trailing spaces.

Edited by Kai Armstrong