diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-03-17 11:27:59 +0100 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-03-17 13:06:19 +0100 |
commit | f04d5bfaf6afcdbc4e91a2fa3069a5438b7fa569 (patch) | |
tree | d922a585a363af92e1b12225387b9a59b716e1d2 | |
parent | 55e2f353d412537a58ff19a63a8cc3d5651d881f (diff) | |
download | gitlab-ce-f04d5bfaf6afcdbc4e91a2fa3069a5438b7fa569.tar.gz |
Wiki will show relative links related to the wiki gollum repository.
-rw-r--r-- | app/helpers/gitlab_markdown_helper.rb | 3 | ||||
-rw-r--r-- | lib/redcarpet/render/gitlab_html.rb | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index 685ef752d84..69425bc171d 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -63,8 +63,7 @@ module GitlabMarkdownHelper # project_path_with_namespace - namespace/projectname, eg. gitlabhq/gitlabhq # ref - name of the branch or reference, eg. stable # requested_path - path of request, eg. doc/api/README.md, used in special case when path is pointing to the .md file were the original request is coming from - # wiki - whether the markdown is from wiki or not - def create_relative_links(text, project, ref, requested_path, wiki = false) + def create_relative_links(text, project, ref, requested_path) @path_to_satellite = project.satellite.path project_path_with_namespace = project.path_with_namespace paths = extract_paths(text) diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb index 2e18b0592b5..86d8b69b0ef 100644 --- a/lib/redcarpet/render/gitlab_html.rb +++ b/lib/redcarpet/render/gitlab_html.rb @@ -46,8 +46,10 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML end def preprocess(full_document) - if @project - h.create_relative_links(full_document, @project, @ref, @request_path, is_wiki?) + if is_wiki? + full_document + elsif @project + h.create_relative_links(full_document, @project, @ref, @request_path) else full_document end |