summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-10-10 17:31:47 +0200
committerMarin Jankovski <maxlazio@gmail.com>2014-10-10 17:31:47 +0200
commit2ea166fc338f95cb9f6db1c61426dce4b2cfd8e1 (patch)
treebf2409c06076bc3e6f162b7bbf1a0796129335e7 /lib
parent4149fc24cfe4ffa2d0d950e7f930529a05899b7c (diff)
downloadgitlab-ce-2ea166fc338f95cb9f6db1c61426dce4b2cfd8e1.tar.gz
Make sure relative url and asset_host are honored, specs.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb
index d3e9bafb06c..ddcce7557a0 100644
--- a/lib/gitlab/markdown.rb
+++ b/lib/gitlab/markdown.rb
@@ -78,9 +78,14 @@ module Gitlab
HTML::Pipeline::Gitlab::GitlabEmojiFilter
]
+ markdown_context = {
+ asset_root: Gitlab.config.gitlab.url,
+ asset_host: Gitlab::Application.config.asset_host
+ }
+
markdown_pipeline = HTML::Pipeline::Gitlab.new(filters).pipeline
- result = markdown_pipeline.call(text)
+ result = markdown_pipeline.call(text, markdown_context)
text = result[:output].to_html(save_with: 0)
allowed_attributes = ActionView::Base.sanitized_allowed_attributes