summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/_svg.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/blob/_svg.html.haml')
-rw-r--r--app/views/projects/blob/_svg.html.haml9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/views/projects/blob/_svg.html.haml b/app/views/projects/blob/_svg.html.haml
new file mode 100644
index 00000000000..93be58fc658
--- /dev/null
+++ b/app/views/projects/blob/_svg.html.haml
@@ -0,0 +1,9 @@
+- if blob.size_within_svg_limits?
+ -# We need to scrub SVG but we cannot do so in the RawController: it would
+ -# be wrong/strange if RawController modified the data.
+ - blob.load_all_data!(@repository)
+ - blob = sanitize_svg(blob)
+ .file-content.image_file
+ %img{ src: "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}", alt: blob.name }
+- else
+ = render 'too_large'