diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 21:07:37 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 21:07:37 +0000 |
commit | 7f8330873c1a5860b8a9a52d111083a65d210249 (patch) | |
tree | e6c7019f2942b8d2fff313545b7cb4bb996b6870 /lib/banzai | |
parent | bbe243060399191abcba33c7ebd611f6ec34c6cd (diff) | |
download | gitlab-ce-7f8330873c1a5860b8a9a52d111083a65d210249.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/relative_link_filter.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb index 2581a179c79..583b0081319 100644 --- a/lib/banzai/filter/relative_link_filter.rb +++ b/lib/banzai/filter/relative_link_filter.rb @@ -152,18 +152,11 @@ module Banzai def rebuild_relative_uri(uri) file_path = nested_file_path_if_exists(uri) - resource_type = uri_type(file_path) - - # Repository routes are under /-/ scope now. - # Since we craft a path without using route helpers we must - # ensure - is added here. - prefix = '-' if %w(tree blob raw commits).include?(resource_type.to_s) uri.path = [ relative_url_root, project.full_path, - prefix, - resource_type, + uri_type(file_path), Addressable::URI.escape(ref).gsub('#', '%23'), Addressable::URI.escape(file_path) ].compact.join('/').squeeze('/').chomp('/') |