summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-06-02 14:56:50 +0200
committerDouwe Maan <douwe@gitlab.com>2015-06-05 12:07:13 +0200
commit4ae67fcaefe7ca66e06933a18368e592d8ebc260 (patch)
tree7d3b171dae75ab143cc2111caa6959cd832e6c7d /app/controllers
parent1f78aeba40f76f6a2f6b44327367282838301a3f (diff)
downloadgitlab-ce-4ae67fcaefe7ca66e06933a18368e592d8ebc260.tar.gz
Show warning when a comment will add 10 or more people to the discussion.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects_controller.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 4ca5fc65459..be5968cd7b0 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -151,7 +151,17 @@ class ProjectsController < ApplicationController
end
def markdown_preview
- render text: view_context.markdown(params[:md_text])
+ text = params[:text]
+
+ ext = Gitlab::ReferenceExtractor.new(@project, current_user)
+ ext.analyze(text)
+
+ render json: {
+ body: view_context.markdown(text),
+ references: {
+ users: ext.users.map(&:username)
+ }
+ }
end
private