When adding a suggestion to a line with a dollar sign ($), the code in the suggestion is broken
Summary
When adding a suggestion on an MR Diff in a line that has the character $
, the resulting suggestion is broken. It seems to be doing an odd replacement.
![](/-/project/278964/uploads/0ef89d9ba435d4dae2e0aee88a0aa069/Screenshot_2020-10-27_at_13.19.36.png)
Steps to reproduce
- Go to a MR diff with a line containing the character
$
(example) - Add a suggestion
- Notice resulting suggestion code is broken
Example Project
https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/1037/diffs
What is the current bug behavior?
For the line:
# Does not parse the `$` currently.
The suggestion outputted into the form is:
```suggestion:-0+0
# Does not parse the ````suggestion:-0+0
currently.
What is the expected correct behavior?
```suggestion:-0+0
# Does not parse the `$` currently.
currently.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)