]> source.dussan.org Git - redmine.git/commitdiff
Merged r2192 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 28 Dec 2008 13:41:03 +0000 (13:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 28 Dec 2008 13:41:03 +0000 (13:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2193 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redcloth3.rb
lib/redmine/wiki_formatting/textile/formatter.rb
test/unit/helpers/application_helper_test.rb

index 038522a89ed5a58e5aa439fee99a1a5d906cd86b..c6ab88660e3bb1b3ee0d4d4ecd42b6da89c871ab 100644 (file)
@@ -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!( /\[([^)]+?)\]/, '' )
index 1a198233cab33b04547cea0d3e3727a90dfa376a..b55287ba461809f600f5eb4417b475143ee0f88e 100644 (file)
@@ -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)
index d2d1a1f198ee49c1ce36227dcf1e2b861e1b2733..01333dcdc91bf2388d9af7d818628514e0bccaac 100644 (file)
@@ -69,7 +69,8 @@ class ApplicationHelperTest < HelperTestCase
       '!http://foo.bar/image.jpg!' => '<img src="http://foo.bar/image.jpg" alt="" />',
       'floating !>http://foo.bar/image.jpg!' => 'floating <div style="float:right"><img src="http://foo.bar/image.jpg" alt="" /></div>',
       'with class !(some-class)http://foo.bar/image.jpg!' => 'with class <img src="http://foo.bar/image.jpg" class="some-class" alt="" />',
-      'with style !{width:100px;height100px}http://foo.bar/image.jpg!' => 'with style <img src="http://foo.bar/image.jpg" style="width:100px;height100px;" alt="" />',
+      # inline styles should be stripped
+      'with style !{width:100px;height100px}http://foo.bar/image.jpg!' => 'with style <img src="http://foo.bar/image.jpg" alt="" />',
       'with title !http://foo.bar/image.jpg(This is a title)!' => 'with title <img src="http://foo.bar/image.jpg" title="This is a title" alt="This is a title" />',
       'with title !http://foo.bar/image.jpg(This is a double-quoted "title")!' => 'with title <img src="http://foo.bar/image.jpg" title="This is a double-quoted &quot;title&quot;" alt="This is a double-quoted &quot;title&quot;" />',
     }