diff options
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 |