From 4fa9fadc48bd3fcf12fda85426267d18a540d955 Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Mon, 15 Dec 2014 23:30:04 +0100 Subject: [PATCH] enable img's style attribute for floats and paddings. --- lib/planet/models/entry.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/planet/models/entry.rb b/lib/planet/models/entry.rb index 6549ef4..9829d0b 100644 --- a/lib/planet/models/entry.rb +++ b/lib/planet/models/entry.rb @@ -8,7 +8,9 @@ class Entry < ActiveRecord::Base def sanitized_body Sanitize.fragment(self.body, Sanitize::Config.merge( Sanitize::Config::BASIC, - :elements => Sanitize::Config::BASIC[:elements] + ['img', 'table'] + :elements => Sanitize::Config::BASIC[:elements] + %w[img table], + :attributes => {'img' => %w[alt src title style]}, + :css => Sanitize::Config::RELAXED[:css] )) end end