summaryrefslogtreecommitdiff
path: root/lib/api/markdown.rb
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2018-09-19 14:58:43 -0500
committerBrett Walker <bwalker@gitlab.com>2018-09-29 11:29:32 -0500
commit829c9c65f9b730b3ecad7d3ba222e3dcd6489b85 (patch)
tree2a9ce8bd65b2bc8291b7c5e63f746c39034ae288 /lib/api/markdown.rb
parente5d3a75aac4f0bb287699b21f3a56b8bfe499665 (diff)
downloadgitlab-ce-829c9c65f9b730b3ecad7d3ba222e3dcd6489b85.tar.gz
post_process markdown redered by API
Diffstat (limited to 'lib/api/markdown.rb')
-rw-r--r--lib/api/markdown.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/api/markdown.rb b/lib/api/markdown.rb
index 5d55224c1a7..09a8c34c5c0 100644
--- a/lib/api/markdown.rb
+++ b/lib/api/markdown.rb
@@ -10,7 +10,8 @@ module API
detail "This feature was introduced in GitLab 11.0."
end
post do
- context = { only_path: false }
+ context = { only_path: false, current_user: current_user }
+ context[:pipeline] = params[:gfm] ? :full : :plain_markdown
if params[:project]
project = Project.find_by_full_path(params[:project])
@@ -22,9 +23,7 @@ module API
context[:skip_project_check] = true
end
- context[:pipeline] = params[:gfm] ? :full : :plain_markdown
-
- { html: Banzai.render(params[:text], context) }
+ { html: Banzai.render_and_post_process(params[:text], context) }
end
end
end