diff options
Diffstat (limited to 'app/controllers/projects/wikis_controller.rb')
-rw-r--r-- | app/controllers/projects/wikis_controller.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index c5e24b9e365..887d18dbec3 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -91,23 +91,20 @@ class Projects::WikisController < Projects::ApplicationController ) end - def preview_markdown - text = params[:text] + def git_access + end - ext = Gitlab::ReferenceExtractor.new(@project, current_user) - ext.analyze(text, author: current_user) + def preview_markdown + result = PreviewMarkdownService.new(@project, current_user, params).execute render json: { - body: view_context.markdown(text, pipeline: :wiki, project_wiki: @project_wiki, page_slug: params[:id]), + body: view_context.markdown(result[:text], pipeline: :wiki, project_wiki: @project_wiki, page_slug: params[:id]), references: { - users: ext.users.map(&:username) + users: result[:users] } } end - def git_access - end - private def load_project_wiki @@ -115,7 +112,6 @@ class Projects::WikisController < Projects::ApplicationController # Call #wiki to make sure the Wiki Repo is initialized @project_wiki.wiki - @sidebar_wiki_entries = WikiPage.group_by_directory(@project_wiki.pages.first(15)) rescue ProjectWiki::CouldNotCreateWikiError flash[:notice] = "Could not create Wiki Repository at this time. Please try again later." |