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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
40da543f
Commit
40da543f
authored
Aug 01, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for relative links starting with ./ or / to RelativeLinkFilter (!5586)
parent
701e5ccb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
CHANGELOG
CHANGELOG
+1
-0
lib/banzai/filter/relative_link_filter.rb
lib/banzai/filter/relative_link_filter.rb
+3
-0
No files found.
CHANGELOG
View file @
40da543f
...
@@ -4,6 +4,7 @@ v 8.11.0 (unreleased)
...
@@ -4,6 +4,7 @@ v 8.11.0 (unreleased)
- Fix the title of the toggle dropdown button. !5515 (herminiotorres)
- Fix the title of the toggle dropdown button. !5515 (herminiotorres)
- Improve diff performance by eliminating redundant checks for text blobs
- Improve diff performance by eliminating redundant checks for text blobs
- Remove magic comments (`# encoding: UTF-8`) from Ruby files. !5456 (winniehell)
- Remove magic comments (`# encoding: UTF-8`) from Ruby files. !5456 (winniehell)
- Add support for relative links starting with ./ or / to RelativeLinkFilter (winniehell)
- Fix CI status icon link underline (ClemMakesApps)
- Fix CI status icon link underline (ClemMakesApps)
- Cache the commit author in RequestStore to avoid extra lookups in PostReceive
- Cache the commit author in RequestStore to avoid extra lookups in PostReceive
- Fix of 'Commits being passed to custom hooks are already reachable when using the UI'
- Fix of 'Commits being passed to custom hooks are already reachable when using the UI'
...
...
lib/banzai/filter/relative_link_filter.rb
View file @
40da543f
...
@@ -87,10 +87,13 @@ module Banzai
...
@@ -87,10 +87,13 @@ module Banzai
def
build_relative_path
(
path
,
request_path
)
def
build_relative_path
(
path
,
request_path
)
return
request_path
if
path
.
empty?
return
request_path
if
path
.
empty?
return
path
unless
request_path
return
path
unless
request_path
return
path
[
1
..-
1
]
if
path
.
start_with?
(
'/'
)
parts
=
request_path
.
split
(
'/'
)
parts
=
request_path
.
split
(
'/'
)
parts
.
pop
if
uri_type
(
request_path
)
!=
:tree
parts
.
pop
if
uri_type
(
request_path
)
!=
:tree
path
.
sub!
(
%r{^
\.
/}
,
''
)
while
path
.
start_with?
(
'../'
)
while
path
.
start_with?
(
'../'
)
parts
.
pop
parts
.
pop
path
.
sub!
(
'../'
,
''
)
path
.
sub!
(
'../'
,
''
)
...
...
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