Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroyuki Sato <h-sato@ruby-dev.jp>2016-10-27 04:47:14 +0300
committerHiroyuki Sato <h-sato@ruby-dev.jp>2016-11-04 08:05:49 +0300
commitbea83d2579ca3b8ca48802f5c114cea60bce396e (patch)
treef48daeca9f352b989c4c6084af7721c07dab839c /app/helpers/diff_helper.rb
parent3a8a7c1251cef4098ffbc54718ba21736c5e2800 (diff)
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