diff options
author | Valery Sizov <valery@gitlab.com> | 2017-05-05 16:59:31 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-05-05 16:59:31 +0300 |
commit | 5004579b15b0585c0a26231d7422fb1d8086bd66 (patch) | |
tree | b9d0096b88813af0d2cb38c173485f56aa62ebc7 /app/controllers/snippets_controller.rb | |
parent | 79b8323d11cc06911b996f327c6e06fd29cafea4 (diff) | |
parent | 10c1bf2d77fd0ab21309d0b136cbc0ac11f56c77 (diff) | |
download | gitlab-ce-5004579b15b0585c0a26231d7422fb1d8086bd66.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into mia_backort[ci skip]
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r-- | app/controllers/snippets_controller.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index da1ae9a34d9..afed27a41d1 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -3,7 +3,6 @@ class SnippetsController < ApplicationController include ToggleAwardEmoji include SpammableActions include SnippetsActions - include MarkdownPreview include RendersBlob before_action :snippet, only: [:show, :edit, :destroy, :update, :raw] @@ -90,7 +89,14 @@ class SnippetsController < ApplicationController end def preview_markdown - render_markdown_preview(params[:text], skip_project_check: true) + result = PreviewMarkdownService.new(@project, current_user, params).execute + + render json: { + body: view_context.markdown(result[:text], skip_project_check: true), + references: { + users: result[:users] + } + } end protected |