summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-09-23 11:44:17 +0000
committerDouwe Maan <douwe@gitlab.com>2015-09-23 11:44:17 +0000
commitff63a166e9cbe9324d4be299cb87c26952efa67e (patch)
tree28bef1be6982a5424b6454d3476fca076a1ddc07 /app/controllers
parente63b64de34a8f00fe1b77afe79dc240cdd654806 (diff)
parent95f73a68fa3ff235c35217b1c72666c5bad6ce03 (diff)
downloadgitlab-ce-ff63a166e9cbe9324d4be299cb87c26952efa67e.tar.gz
Merge branch 'rs-fix-help-links' into 'master'
Prevent double-prefixing of help page paths Closes #2679 See merge request !1400
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/help_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index ad00948da51..55050615473 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -4,6 +4,11 @@ class HelpController < ApplicationController
layout 'help'
def index
+ @help_index = File.read(Rails.root.join('doc', 'README.md'))
+
+ # Prefix Markdown links with `help/` unless they already have been
+ # See http://rubular.com/r/nwwhzH6Z8X
+ @help_index.gsub!(/(\]\()(?!help\/)([^\)\(]+)(\))/, '\1help/\2\3')
end
def show