From c256121833008057f9f6834f9268aa77e0fc9ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 7 Feb 2019 12:09:06 +0100 Subject: [PATCH] FIX: add support for style element in SVGs --- lib/upload_creator.rb | 2 +- spec/fixtures/images/image.svg | 5 ++++- spec/models/upload_spec.rb | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/upload_creator.rb b/lib/upload_creator.rb index a1386feb2e3..0aa4af84b15 100644 --- a/lib/upload_creator.rb +++ b/lib/upload_creator.rb @@ -9,7 +9,7 @@ class UploadCreator WHITELISTED_SVG_ELEMENTS ||= %w{ circle clippath defs ellipse g line linearGradient path polygon polyline - radialGradient rect stop svg text textpath tref tspan use + radialGradient rect stop style svg text textpath tref tspan use }.each(&:freeze) # Available options diff --git a/spec/fixtures/images/image.svg b/spec/fixtures/images/image.svg index b95c0f4a79e..f997dcfde20 100644 --- a/spec/fixtures/images/image.svg +++ b/spec/fixtures/images/image.svg @@ -1,3 +1,6 @@ - Discourse + + Discourse diff --git a/spec/models/upload_spec.rb b/spec/models/upload_spec.rb index 1fe964da54b..95ed94f7dc1 100644 --- a/spec/models/upload_spec.rb +++ b/spec/models/upload_spec.rb @@ -45,6 +45,16 @@ describe Upload do end end + it "supports