gitlab-org--gitlab-foss/app/views/projects/blob/_image.html.haml

10 lines
417 B
Text
Raw Normal View History

.file-content.image_file
- if blob.svg?
2016-02-17 05:08:47 -05:00
- # We need to scrub SVG but we cannot do so in the RawController: it would
- # be wrong/strange if RawController modified the data.
2016-02-16 11:01:25 -05:00
- blob.load_all_data!(@repository)
- blob = sanitize_svg(blob)
2016-02-17 05:08:47 -05:00
%img{src: "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}"}
2016-02-16 11:01:25 -05:00
- else
2016-02-17 05:08:47 -05:00
%img{src: namespace_project_raw_path(@project.namespace, @project, @id)}