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.
This commit is contained in:
David Eisner 2016-10-04 16:25:45 +01:00 committed by Airat Shigapov
parent eb074021b0
commit b434b75fd0
No known key found for this signature in database
GPG key ID: 95B04300D2844C47

View file

@ -125,12 +125,16 @@ class HipchatService < Service
message
end
def markdown(text, context = {})
def markdown(text, options = {})
if text
context = ({
context = {
project: project,
pipeline: :email
}).merge(context)
}
Banzai.render(text, context)
context.merge!(options)
html = Banzai.render(text, context)
html = Banzai.post_process(html, context)