Commit e8c144af authored by Douwe Maan's avatar Douwe Maan Committed by Robert Speicher

Merge branch 'rs-fix-help-links' into 'master'

Prevent double-prefixing of help page paths

Closes #2679 

See merge request !1400
parent 9911f86c
...@@ -4,6 +4,11 @@ class HelpController < ApplicationController ...@@ -4,6 +4,11 @@ class HelpController < ApplicationController
layout 'help' layout 'help'
def index 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 end
def show def show
......
...@@ -27,11 +27,7 @@ ...@@ -27,11 +27,7 @@
.col-md-8 .col-md-8
.documentation-index .documentation-index
= preserve do = preserve do
- readme_text = File.read(Rails.root.join("doc", "README.md")) = markdown(@help_index)
- text = readme_text.dup
- readme_text.scan(/\]\(([^(]+)\)/) { |match| text.gsub!(match.first, "help/#{match.first}") }
= markdown text
.col-md-4 .col-md-4
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
### Administrator documentation ### Administrator documentation
+ [User permissions](permissions/README.md) + [User permissions](permissions/permissions.md)
+ [API](api/README.md) + [API](api/README.md)
## Contributor documentation ## Contributor documentation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment