Commit d43d7471c17a67174da2b53bea63d39e7a43a35e
Exists in
master
and in
4 other branches
Merge branch 'fix/relative_render' of /home/git/repositories/gitlab/gitlabhq
Showing
3 changed files
with
22 additions
and
1 deletions
Show diff stats
features/project/source/markdown_render.feature
| ... | ... | @@ -68,3 +68,8 @@ Feature: Project markdown render |
| 68 | 68 | When I go back to wiki page home |
| 69 | 69 | And I click on Rake tasks link |
| 70 | 70 | Then I see Rake tasks directory |
| 71 | + | |
| 72 | + Scenario: I visit the help page with markdown | |
| 73 | + Given I visit to the help page | |
| 74 | + And I select a page with markdown | |
| 75 | + Then I should see a help page with markdown | |
| 71 | 76 | \ No newline at end of file | ... | ... |
features/steps/project/project_markdown_render.rb
| ... | ... | @@ -150,4 +150,16 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps |
| 150 | 150 | page.should have_content "backup_restore.md" |
| 151 | 151 | page.should have_content "maintenance.md" |
| 152 | 152 | end |
| 153 | + | |
| 154 | + Given 'I visit to the help page' do | |
| 155 | + visit help_path | |
| 156 | + end | |
| 157 | + | |
| 158 | + And 'I select a page with markdown' do | |
| 159 | + click_link "Rake Tasks" | |
| 160 | + end | |
| 161 | + | |
| 162 | + Then 'I should see a help page with markdown' do | |
| 163 | + page.should have_content "GitLab provides some specific rake tasks to enable special features or perform maintenance tasks" | |
| 164 | + end | |
| 153 | 165 | end |
| 154 | 166 | \ No newline at end of file | ... | ... |
lib/redcarpet/render/gitlab_html.rb
| ... | ... | @@ -35,7 +35,11 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | 37 | def preprocess(full_document) |
| 38 | - h.create_relative_links(full_document, @project.path_with_namespace, @ref, @request_path, is_wiki?) | |
| 38 | + if @project | |
| 39 | + h.create_relative_links(full_document, @project.path_with_namespace, @ref, @request_path, is_wiki?) | |
| 40 | + else | |
| 41 | + full_document | |
| 42 | + end | |
| 39 | 43 | end |
| 40 | 44 | |
| 41 | 45 | def postprocess(full_document) | ... | ... |