diff --git a/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb b/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
index 210bba832..3d931bb3c 100644
--- a/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
@@ -46,4 +46,22 @@ class Redmine::WikiFormatting::HtmlParserTest < ActiveSupport::TestCase
assert_equal expected, @parser.to_text(html)
end
end
+
+ def test_should_remove_space_of_beginning_of_line
+ str = <<~HTML
+
+
+ | th1 |
+ th2 |
+
+
+ | td1 |
+ td2 |
+
+
+ HTML
+
+ assert_equal "th1\n\nth2\n\ntd1\n\ntd2",
+ @parser.to_text(str)
+ end
end
diff --git a/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb b/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb
index 6a4b77387..45a5a52f9 100644
--- a/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb
@@ -34,4 +34,9 @@ class Redmine::WikiFormatting::MarkdownHtmlParserTest < ActiveSupport::TestCase
assert_equal 'foo http://example.com/ baz',
@parser.to_text('foobaz')
end
+
+ def test_html_tables_conversion
+ assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
+ @parser.to_text('')
+ end
end
diff --git a/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb
index a338ed528..86d7e66d2 100644
--- a/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb
@@ -34,4 +34,9 @@ class Redmine::WikiFormatting::TextileHtmlParserTest < ActiveSupport::TestCase
assert_equal 'foo http://example.com/ baz',
@parser.to_text('foobaz')
end
+
+ def test_html_tables_conversion
+ assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
+ @parser.to_text('')
+ end
end