summaryrefslogtreecommitdiff
path: root/app/helpers/diff_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r--app/helpers/diff_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index f489f9aa0d6..c35d6611ab0 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -55,7 +55,9 @@ module DiffHelper
if line.blank?
" ".html_safe
else
- line.sub(/^[\-+ ]/, '').html_safe
+ # We can't use `sub` because the HTML-safeness of `line` will not survive.
+ line[0] = '' if line.start_with?('+', '-', ' ')
+ line
end
end