sorry for short english and ugly code.
if diff contains tag(ex, xml file changes), incorrectly rendering html in emails
diff --git a/app/helpers/diff_mailer_helper.rb b/app/helpers/diff_mailer_helper.rb
index 26d2891..92fa3e6 100644
--- a/app/helpers/diff_mailer_helper.rb
+++ b/app/helpers/diff_mailer_helper.rb
@@ -43,12 +43,12 @@ module DiffMailerHelper
<th #{replace_css("line-num")}>#{line.nb_line_right}</th>]
if line.line_left.empty?
result += %Q[<td #{replace_css(line.type_diff_right)}">
- <pre #{replace_css("line-code")}>#{Redmine::CodesetUtil.to_utf8_by_setting line.line_right}</pre>
+ <pre #{replace_css("line-code")}>#{Redmine::CodesetUtil.to_utf8_by_setting line.line_right.gsub(/</, '<').gsub(/>/, '>')}</pre>
</td>]
else
result += %Q[
<td #{replace_css(line.type_diff_left)}">
- <pre #{replace_css("line-code")}>#{Redmine::CodesetUtil.to_utf8_by_setting line.line_left}</pre>
+ <pre #{replace_css("line-code")}>#{Redmine::CodesetUtil.to_utf8_by_setting line.line_left.gsub(/</, '<').gsub(/>/, '>')}</pre>
</td>]
end
sorry for short english and ugly code.
if diff contains tag(ex, xml file changes), incorrectly rendering html in emails