@@ -470,8 +470,7 class RedCloth3 < String | |||||
470 | style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN |
|
470 | style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN | |
471 | end |
|
471 | end | |
472 |
|
472 | |||
473 |
style << "#{ htmlesc $1 };" if |
|
473 | style << "#{ htmlesc $1 };" if text.sub!( /\{([^}]*)\}/, '' ) && !filter_styles | |
474 | text.sub!( /\{([^}]*)\}/, '' ) |
|
|||
475 |
|
474 | |||
476 | lang = $1 if |
|
475 | lang = $1 if | |
477 | text.sub!( /\[([^)]+?)\]/, '' ) |
|
476 | text.sub!( /\[([^)]+?)\]/, '' ) |
@@ -30,6 +30,7 module Redmine | |||||
30 | super |
|
30 | super | |
31 | self.hard_breaks=true |
|
31 | self.hard_breaks=true | |
32 | self.no_span_caps=true |
|
32 | self.no_span_caps=true | |
|
33 | self.filter_styles=true | |||
33 | end |
|
34 | end | |
34 |
|
35 | |||
35 | def to_html(*rules, &block) |
|
36 | def to_html(*rules, &block) |
@@ -69,7 +69,8 class ApplicationHelperTest < HelperTestCase | |||||
69 | '!http://foo.bar/image.jpg!' => '<img src="http://foo.bar/image.jpg" alt="" />', |
|
69 | '!http://foo.bar/image.jpg!' => '<img src="http://foo.bar/image.jpg" alt="" />', | |
70 | 'floating !>http://foo.bar/image.jpg!' => 'floating <div style="float:right"><img src="http://foo.bar/image.jpg" alt="" /></div>', |
|
70 | 'floating !>http://foo.bar/image.jpg!' => 'floating <div style="float:right"><img src="http://foo.bar/image.jpg" alt="" /></div>', | |
71 | 'with class !(some-class)http://foo.bar/image.jpg!' => 'with class <img src="http://foo.bar/image.jpg" class="some-class" alt="" />', |
|
71 | 'with class !(some-class)http://foo.bar/image.jpg!' => 'with class <img src="http://foo.bar/image.jpg" class="some-class" alt="" />', | |
72 | 'with style !{width:100px;height100px}http://foo.bar/image.jpg!' => 'with style <img src="http://foo.bar/image.jpg" style="width:100px;height100px;" alt="" />', |
|
72 | # inline styles should be stripped | |
|
73 | 'with style !{width:100px;height100px}http://foo.bar/image.jpg!' => 'with style <img src="http://foo.bar/image.jpg" alt="" />', | |||
73 | '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" />', |
|
74 | '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" />', | |
74 | '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 "title"" alt="This is a double-quoted "title"" />', |
|
75 | '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 "title"" alt="This is a double-quoted "title"" />', | |
75 | } |
|
76 | } |
General Comments 0
You need to be logged in to leave comments.
Login now