summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-04-20 10:56:41 +0200
committerJarka Kadlecova <jarka@gitlab.com>2017-04-26 12:51:06 +0200
commit87327c5845a7feec92e546dc0da42282ac27de40 (patch)
tree87134624b3911bf49b2799fecd89f4a4334dc0c9 /app/controllers/snippets_controller.rb
parenta9da37434af6d44c5f851affd4bd69b370760e8e (diff)
downloadgitlab-ce-87327c5845a7feec92e546dc0da42282ac27de40.tar.gz
Support preview_markdown action for personal_snippets
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index f3fd3da8b20..056910fad67 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -2,6 +2,7 @@ class SnippetsController < ApplicationController
include ToggleAwardEmoji
include SpammableActions
include SnippetsActions
+ include MarkdownPreview
before_action :snippet, only: [:show, :edit, :destroy, :update, :raw, :download]
@@ -77,6 +78,10 @@ class SnippetsController < ApplicationController
)
end
+ def preview_markdown
+ render_markdown_preview(params[:text], skip_project_check: true)
+ end
+
protected
def snippet