Project

General

Profile

Defect #18223 » redmine_18223.diff

Jens Krämer, 2015-08-18 11:36

View differences:

lib/redcloth3.rb
525 525
            tatts = pba( tatts, 'table' )
526 526
            tatts = shelve( tatts ) if tatts
527 527
            rows = []
528
            fullrow.gsub!(/([^|])\n/, "\\1<br />")
528
            fullrow.gsub!(/([^|\s])\s*\n/, "\\1<br />")
529 529
            fullrow.each_line do |row|
530 530
                ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
531 531
                cells = []
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
249 249
    assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
250 250
  end
251 251

  
252
  def test_table_with_trailing_whitespace
253
    raw = <<-RAW
254
This is a table with trailing whitespace in one row:
255

  
256
|cell11|cell12|
257
|cell21|cell22| 
258
|cell31|cell32|
259
RAW
260

  
261
    expected = <<-EXPECTED
262
<p>This is a table with trailing whitespace in one row:</p>
263

  
264
<table>
265
  <tr><td>cell11</td><td>cell12</td></tr>
266
  <tr><td>cell21</td><td>cell22</td></tr>
267
  <tr><td>cell31</td><td>cell32</td></tr>
268
</table>
269
EXPECTED
270

  
271
    assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
272
  end
273

  
252 274
  def test_table_with_line_breaks
253 275
    raw = <<-RAW
254 276
This is a table with line breaks:
    (1-1/1)