Commit b434b75f authored by David Eisner's avatar David Eisner Committed by Airat Shigapov

Ensure absolute URLs for single lines from Banzai for HipChat

"pipeline: :single_line" leaves the protocol/host part out of the URLs
and caches them that way. To avoid giving those out to HipChat, markdown
is always rendered with "pipeline: :email" first.

There must be a better way to do this, but I can't see how to avoid the
link caching.
parent eb074021
...@@ -125,12 +125,16 @@ class HipchatService < Service ...@@ -125,12 +125,16 @@ class HipchatService < Service
message message
end end
def markdown(text, context = {}) def markdown(text, options = {})
if text if text
context = ({ context = {
project: project, project: project,
pipeline: :email pipeline: :email
}).merge(context) }
Banzai.render(text, context)
context.merge!(options)
html = Banzai.render(text, context) html = Banzai.render(text, context)
html = Banzai.post_process(html, context) html = Banzai.post_process(html, context)
......
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