summaryrefslogtreecommitdiff
path: root/app/helpers/diff_helper.rb
diff options
context:
space:
mode:
authorHiroyuki Sato <h-sato@ruby-dev.jp>2016-10-27 10:47:14 +0900
committerHiroyuki Sato <h-sato@ruby-dev.jp>2016-11-04 14:05:49 +0900
commitbea83d2579ca3b8ca48802f5c114cea60bce396e (patch)
treef48daeca9f352b989c4c6084af7721c07dab839c /app/helpers/diff_helper.rb
parent3a8a7c1251cef4098ffbc54718ba21736c5e2800 (diff)
downloadgitlab-ce-bea83d2579ca3b8ca48802f5c114cea60bce396e.tar.gz
Remove an extra leading space from diff content
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r--app/helpers/diff_helper.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index 0725c3f4c56..f489f9aa0d6 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -51,12 +51,11 @@ module DiffHelper
html.html_safe
end
- def diff_line_content(line, line_type = nil)
+ def diff_line_content(line)
if line.blank?
- " &nbsp;".html_safe
+ "&nbsp;".html_safe
else
- line[0] = ' ' if %w[new old].include?(line_type)
- line
+ line.sub(/^[\-+ ]/, '').html_safe
end
end