Commit 93f6fcc9 authored by Sean McGivern's avatar Sean McGivern

Don't remove + / - signs from diff emails

In the browser, we remove the + and - signs from the front of a diff
line because we add them in with CSS, so they aren't copied. We can't do
that in an email, because the CSS isn't supported, so we should keep
them in that case.
parent 854fbbfb
...@@ -51,9 +51,11 @@ module DiffHelper ...@@ -51,9 +51,11 @@ module DiffHelper
html.html_safe html.html_safe
end end
def diff_line_content(line) def diff_line_content(line, email: false)
if line.blank? if line.blank?
" ".html_safe " ".html_safe
elsif email
line.html_safe
else else
line.sub(/^[\-+ ]/, '').html_safe line.sub(/^[\-+ ]/, '').html_safe
end end
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
%a{href: "##{line_code}", data: { linenumber: link_text }} %a{href: "##{line_code}", data: { linenumber: link_text }}
%td.line_content.noteable_line{ class: type, data: (diff_view_line_data(line_code, diff_file.position(line), type) unless plain) }< %td.line_content.noteable_line{ class: type, data: (diff_view_line_data(line_code, diff_file.position(line), type) unless plain) }<
- if email - if email
%pre= diff_line_content(line.text) %pre= diff_line_content(line.text, email: true)
- else - else
= diff_line_content(line.text) = diff_line_content(line.text)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment