diff options
author | Nick Thomas <nick@gitlab.com> | 2018-01-16 19:07:47 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-01-16 19:11:02 +0300 |
commit | 31e59219891cf755c9a71e145385af6da9d290b9 (patch) | |
tree | 406bdcf2a8e19269e986e675286292211481f834 /lib | |
parent | 0f449ecc3797337333f595a86a6b282b866067e3 (diff) |
Fix links to uploaded files on wiki pages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/wiki_link_filter/rewriter.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/banzai/filter/wiki_link_filter/rewriter.rb b/lib/banzai/filter/wiki_link_filter/rewriter.rb index e7a1ec8457d..072d24e5a11 100644 --- a/lib/banzai/filter/wiki_link_filter/rewriter.rb +++ b/lib/banzai/filter/wiki_link_filter/rewriter.rb @@ -9,6 +9,10 @@ module Banzai end def apply_rules + # Special case: relative URLs beginning with `/uploads/` refer to + # user-uploaded files and will be handled elsewhere. + return @uri.to_s if @uri.relative? && @uri.path.starts_with?('/uploads/') + apply_file_link_rules! apply_hierarchical_link_rules! apply_relative_link_rules! |