Patch #22898 » 0001-Fix-HTML-generated-for-floating-images-in-paragraphs.patch
| lib/redcloth3.rb | ||
|---|---|---|
| 970 | 970 |
if stln == "<p>" |
| 971 | 971 |
out = "<p style=\"float:#{ algn }\">#{ out }"
|
| 972 | 972 |
else |
| 973 |
out = "#{ stln }<div style=\"float:#{ algn }\">#{ out }</div>"
|
|
| 973 |
out = "#{ stln }<span style=\"float:#{ algn }\">#{ out }</span>"
|
|
| 974 | 974 |
end |
| 975 | 975 |
else |
| 976 | 976 |
out = stln + out |
| test/unit/helpers/application_helper_test.rb | ||
|---|---|---|
| 116 | 116 |
def test_inline_images |
| 117 | 117 |
to_test = {
|
| 118 | 118 |
'!http://foo.bar/image.jpg!' => '<img src="http://foo.bar/image.jpg" alt="" />', |
| 119 |
'floating !>http://foo.bar/image.jpg!' => 'floating <div style="float:right"><img src="http://foo.bar/image.jpg" alt="" /></div>',
|
|
| 119 |
'floating !>http://foo.bar/image.jpg!' => 'floating <span style="float:right"><img src="http://foo.bar/image.jpg" alt="" /></span>',
|
|
| 120 | 120 |
'with class !(some-class)http://foo.bar/image.jpg!' => 'with class <img src="http://foo.bar/image.jpg" class="some-class" alt="" />', |
| 121 | 121 |
'with style !{width:100px;height:100px}http://foo.bar/image.jpg!' => 'with style <img src="http://foo.bar/image.jpg" style="width:100px;height:100px;" alt="" />',
|
| 122 | 122 |
'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" />', |