From 15f4a2079f3a78f9c6c47d7287813b773de3a74c Mon Sep 17 00:00:00 2001 From: Bat Date: Mon, 3 Sep 2018 10:22:14 +0100 Subject: [PATCH] Add support for SVG medias --- plume-models/src/medias.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plume-models/src/medias.rs b/plume-models/src/medias.rs index b656631..3dabd22 100644 --- a/plume-models/src/medias.rs +++ b/plume-models/src/medias.rs @@ -38,7 +38,7 @@ impl Media { pub fn to_json(&self, conn: &PgConnection) -> serde_json::Value { let mut json = serde_json::to_value(self).unwrap(); let (preview, html) = match self.file_path.rsplitn(2, '.').next().unwrap() { - "png" | "jpg" | "jpeg" | "gif" => ( + "png" | "jpg" | "jpeg" | "gif" | "svg" => ( format!("\"{}\"", self.url(conn), self.alt_text, self.alt_text), format!("\"{}\"", self.url(conn), self.alt_text, self.alt_text) ),