Full Banzai rendering for HipChat notifications

This commit is contained in:
David Eisner 2016-10-04 12:28:42 +01:00 committed by Airat Shigapov
parent b5d210c9d6
commit 3d034c1501
No known key found for this signature in database
GPG key ID: 95B04300D2844C47

View file

@ -121,14 +121,6 @@ class HipchatService < Service
message
end
def format_body(body)
if body
body = body.truncate(200, separator: ' ', omission: '...')
end
"<pre>#{body}</pre>"
end
def create_issue_message(data)
user_name = data[:user][:name]
@ -144,7 +136,7 @@ class HipchatService < Service
message = "#{user_name} #{state} #{issue_link} in #{project_link}: <b>#{title}</b>"
if description
message << format_body(Banzai::Filter::MarkdownFilter.renderer.render(description))
message << Banzai.render(note, project: project)
end
message
@ -166,7 +158,7 @@ class HipchatService < Service
"#{project_link}: <b>#{title}</b>"
if description
message << format_body(Banzai::Filter::MarkdownFilter.renderer.render(description))
message << Banzai.render(note, project: project)
end
message
@ -217,7 +209,7 @@ class HipchatService < Service
message << title
if note
message << format_body(Banzai::Filter::MarkdownFilter.renderer.render(note))
message << Banzai.render(note, project: project)
end
message