BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
17e3d3fd
Commit
17e3d3fd
authored
Dec 06, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid escaping relative links in Markdown twice (!7940)
parent
7a9ba9bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
unescape-relative-path.yml
changelogs/unreleased/unescape-relative-path.yml
+4
-0
relative_link_filter.rb
lib/banzai/filter/relative_link_filter.rb
+6
-8
No files found.
changelogs/unreleased/unescape-relative-path.yml
0 → 100644
View file @
17e3d3fd
---
title
:
Avoid escaping relative links in Markdown twice
merge_request
:
7940
author
:
winniehell
lib/banzai/filter/relative_link_filter.rb
View file @
17e3d3fd
...
...
@@ -46,7 +46,7 @@ module Banzai
end
def
rebuild_relative_uri
(
uri
)
file_path
=
relative_file_path
(
uri
.
path
)
file_path
=
relative_file_path
(
uri
)
uri
.
path
=
[
relative_url_root
,
...
...
@@ -59,8 +59,10 @@ module Banzai
uri
end
def
relative_file_path
(
path
)
nested_path
=
build_relative_path
(
path
,
context
[
:requested_path
])
def
relative_file_path
(
uri
)
path
=
Addressable
::
URI
.
unescape
(
uri
.
path
)
request_path
=
Addressable
::
URI
.
unescape
(
context
[
:requested_path
])
nested_path
=
build_relative_path
(
path
,
request_path
)
file_exists?
(
nested_path
)
?
nested_path
:
path
end
...
...
@@ -108,11 +110,7 @@ module Banzai
end
def
uri_type
(
path
)
@uri_types
[
path
]
||=
begin
unescaped_path
=
Addressable
::
URI
.
unescape
(
path
)
current_commit
.
uri_type
(
unescaped_path
)
end
@uri_types
[
path
]
||=
current_commit
.
uri_type
(
path
)
end
def
current_commit
...
...
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