Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f04d5bfa
Commit
f04d5bfa
authored
Mar 17, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wiki will show relative links related to the wiki gollum repository.
parent
55e2f353
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
app/helpers/gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+1
-2
lib/redcarpet/render/gitlab_html.rb
lib/redcarpet/render/gitlab_html.rb
+4
-2
No files found.
app/helpers/gitlab_markdown_helper.rb
View file @
f04d5bfa
...
...
@@ -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
)
...
...
lib/redcarpet/render/gitlab_html.rb
View file @
f04d5bfa
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment