Commit f04d5bfaf6afcdbc4e91a2fa3069a5438b7fa569
1 parent
55e2f353
Exists in
spb-stable
and in
3 other branches
Wiki will show relative links related to the wiki gollum repository.
Showing
2 changed files
with
5 additions
and
4 deletions
Show diff stats
app/helpers/gitlab_markdown_helper.rb
| ... | ... | @@ -63,8 +63,7 @@ module GitlabMarkdownHelper |
| 63 | 63 | # project_path_with_namespace - namespace/projectname, eg. gitlabhq/gitlabhq |
| 64 | 64 | # ref - name of the branch or reference, eg. stable |
| 65 | 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 | 67 | @path_to_satellite = project.satellite.path |
| 69 | 68 | project_path_with_namespace = project.path_with_namespace |
| 70 | 69 | paths = extract_paths(text) | ... | ... |
lib/redcarpet/render/gitlab_html.rb
| ... | ... | @@ -46,8 +46,10 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML |
| 46 | 46 | end |
| 47 | 47 | |
| 48 | 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 | 53 | else |
| 52 | 54 | full_document |
| 53 | 55 | end | ... | ... |