Commit f04d5bfaf6afcdbc4e91a2fa3069a5438b7fa569

Authored by Marin Jankovski
1 parent 55e2f353

Wiki will show relative links related to the wiki gollum repository.

app/helpers/gitlab_markdown_helper.rb
@@ -63,8 +63,7 @@ module GitlabMarkdownHelper @@ -63,8 +63,7 @@ module GitlabMarkdownHelper
63 # project_path_with_namespace - namespace/projectname, eg. gitlabhq/gitlabhq 63 # project_path_with_namespace - namespace/projectname, eg. gitlabhq/gitlabhq
64 # ref - name of the branch or reference, eg. stable 64 # ref - name of the branch or reference, eg. stable
65 # 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 65 # 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
66 - # wiki - whether the markdown is from wiki or not  
67 - def create_relative_links(text, project, ref, requested_path, wiki = false) 66 + def create_relative_links(text, project, ref, requested_path)
68 @path_to_satellite = project.satellite.path 67 @path_to_satellite = project.satellite.path
69 project_path_with_namespace = project.path_with_namespace 68 project_path_with_namespace = project.path_with_namespace
70 paths = extract_paths(text) 69 paths = extract_paths(text)
lib/redcarpet/render/gitlab_html.rb
@@ -46,8 +46,10 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML @@ -46,8 +46,10 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
46 end 46 end
47 47
48 def preprocess(full_document) 48 def preprocess(full_document)
49 - if @project  
50 - h.create_relative_links(full_document, @project, @ref, @request_path, is_wiki?) 49 + if is_wiki?
  50 + full_document
  51 + elsif @project
  52 + h.create_relative_links(full_document, @project, @ref, @request_path)
51 else 53 else
52 full_document 54 full_document
53 end 55 end