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
b791dcc0
Commit
b791dcc0
authored
Aug 05, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore URLs starting with // (!5677)
parent
c9e15be9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
CHANGELOG
CHANGELOG
+1
-0
lib/banzai/filter/relative_link_filter.rb
lib/banzai/filter/relative_link_filter.rb
+2
-1
No files found.
CHANGELOG
View file @
b791dcc0
...
...
@@ -8,6 +8,7 @@ v 8.11.0 (unreleased)
- Convert switch icon into icon font (ClemMakesApps)
- Remove magic comments (`# encoding: UTF-8`) from Ruby files. !5456 (winniehell)
- Add support for relative links starting with ./ or / to RelativeLinkFilter (winniehell)
- Ignore URLs starting with // in Markdown links !5677 (winniehell)
- Fix CI status icon link underline (ClemMakesApps)
- The Repository class is now instrumented
- Cache the commit author in RequestStore to avoid extra lookups in PostReceive
...
...
lib/banzai/filter/relative_link_filter.rb
View file @
b791dcc0
...
...
@@ -35,6 +35,7 @@ module Banzai
def
process_link_attr
(
html_attr
)
return
if
html_attr
.
blank?
return
if
html_attr
.
value
.
start_with?
(
'//'
)
uri
=
URI
(
html_attr
.
value
)
if
uri
.
relative?
&&
uri
.
path
.
present?
...
...
@@ -92,7 +93,7 @@ module Banzai
parts
=
request_path
.
split
(
'/'
)
parts
.
pop
if
uri_type
(
request_path
)
!=
:tree
path
.
sub!
(
%r{
^
\.
/}
,
''
)
path
.
sub!
(
%r{
\A
\.
/}
,
''
)
while
path
.
start_with?
(
'../'
)
parts
.
pop
...
...
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