diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb
index 038522a89..c6ab88660 100644
--- a/lib/redcloth3.rb
+++ b/lib/redcloth3.rb
@@ -470,8 +470,7 @@ class RedCloth3 < String
style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN
end
- style << "#{ htmlesc $1 };" if not filter_styles and
- text.sub!( /\{([^}]*)\}/, '' )
+ style << "#{ htmlesc $1 };" if text.sub!( /\{([^}]*)\}/, '' ) && !filter_styles
lang = $1 if
text.sub!( /\[([^)]+?)\]/, '' )
diff --git a/lib/redmine/wiki_formatting/textile/formatter.rb b/lib/redmine/wiki_formatting/textile/formatter.rb
index 1a198233c..b55287ba4 100644
--- a/lib/redmine/wiki_formatting/textile/formatter.rb
+++ b/lib/redmine/wiki_formatting/textile/formatter.rb
@@ -30,6 +30,7 @@ module Redmine
super
self.hard_breaks=true
self.no_span_caps=true
+ self.filter_styles=true
end
def to_html(*rules, &block)
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index d2d1a1f19..01333dcdc 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -69,7 +69,8 @@ class ApplicationHelperTest < HelperTestCase
'!http://foo.bar/image.jpg!' => '',
'floating !>http://foo.bar/image.jpg!' => 'floating