Commit 3d034c15 authored by David Eisner's avatar David Eisner Committed by Airat Shigapov

Full Banzai rendering for HipChat notifications

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