mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 23:11:12 +00:00
Table renders wrong if a trailing space is after | symbol (#18223).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@14611 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
41011013be
commit
49604a3bae
@ -525,7 +525,7 @@ class RedCloth3 < String
|
|||||||
tatts = pba( tatts, 'table' )
|
tatts = pba( tatts, 'table' )
|
||||||
tatts = shelve( tatts ) if tatts
|
tatts = shelve( tatts ) if tatts
|
||||||
rows = []
|
rows = []
|
||||||
fullrow.gsub!(/([^|])\n/, "\\1<br />")
|
fullrow.gsub!(/([^|\s])\s*\n/, "\\1<br />")
|
||||||
fullrow.each_line do |row|
|
fullrow.each_line do |row|
|
||||||
ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
|
ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
|
||||||
cells = []
|
cells = []
|
||||||
|
|||||||
@ -249,6 +249,28 @@ EXPECTED
|
|||||||
assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
|
assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_table_with_trailing_whitespace
|
||||||
|
raw = <<-RAW
|
||||||
|
This is a table with trailing whitespace in one row:
|
||||||
|
|
||||||
|
|cell11|cell12|
|
||||||
|
|cell21|cell22|
|
||||||
|
|cell31|cell32|
|
||||||
|
RAW
|
||||||
|
|
||||||
|
expected = <<-EXPECTED
|
||||||
|
<p>This is a table with trailing whitespace in one row:</p>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr><td>cell11</td><td>cell12</td></tr>
|
||||||
|
<tr><td>cell21</td><td>cell22</td></tr>
|
||||||
|
<tr><td>cell31</td><td>cell32</td></tr>
|
||||||
|
</table>
|
||||||
|
EXPECTED
|
||||||
|
|
||||||
|
assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
|
||||||
|
end
|
||||||
|
|
||||||
def test_table_with_line_breaks
|
def test_table_with_line_breaks
|
||||||
raw = <<-RAW
|
raw = <<-RAW
|
||||||
This is a table with line breaks:
|
This is a table with line breaks:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user