Skip to content
Snippets Groups Projects
Commit 3b1da9be authored by Heinrich Lee Yu's avatar Heinrich Lee Yu :basketball:
Browse files

Fix inline rendering of SVGs from current repo

Changes generated URL to raw instead of blob
parent 52b857f1
No related branches found
No related tags found
No related merge requests found
---
title: Fix inline rendering of relative paths to SVGs from the current repository
merge_request: 31352
author:
type: fixed
Loading
Loading
@@ -45,7 +45,7 @@ module Gitlab
end
 
def image?
['.png', '.jpg', '.jpeg', '.gif'].include?(extname.downcase)
['.png', '.jpg', '.jpeg', '.gif', '.svg'].include?(extname.downcase)
end
 
# Internal: Lookup mime type for extension.
Loading
Loading
Loading
Loading
@@ -556,6 +556,7 @@ eos
it 'returns the URI type at the given path' do
expect(commit.uri_type('files/html')).to be(:tree)
expect(commit.uri_type('files/images/logo-black.png')).to be(:raw)
expect(commit.uri_type('files/images/wm.svg')).to be(:raw)
expect(project.commit('video').uri_type('files/videos/intro.mp4')).to be(:raw)
expect(commit.uri_type('files/js/application.js')).to be(:blob)
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment