Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18384
e93f8b46-1217-0410-a6f0-
8f06a7374b81
assert_equal expected, @parser.to_text(html)
end
end
+
+ def test_should_remove_space_of_beginning_of_line
+ str = <<~HTML
+ <table>
+ <tr>
+ <th>th1</th>
+ <th>th2</th>
+ </tr>
+ <tr>
+ <td>td1</td>
+ <td>td2</td>
+ </tr>
+ </table>
+ HTML
+
+ assert_equal "th1\n\nth2\n\ntd1\n\ntd2",
+ @parser.to_text(str)
+ end
end
assert_equal 'foo http://example.com/ baz',
@parser.to_text('foo<a href="http://example.com/"></a>baz')
end
+
+ def test_html_tables_conversion
+ assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
+ @parser.to_text('<table><tr><th>th1</th><th>th2</th></tr><tr><td>td1</td><td>td2</td></tr></table>')
+ end
end
assert_equal 'foo http://example.com/ baz',
@parser.to_text('foo<a href="http://example.com/"></a>baz')
end
+
+ def test_html_tables_conversion
+ assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
+ @parser.to_text('<table><tr><th>th1</th><th>th2</th></tr><tr><td>td1</td><td>td2</td></tr></table>')
+ end
end