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 7900a5af86..a75d1c8f6b 100644
--- a/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
@@ -34,4 +34,22 @@ class Redmine::WikiFormatting::HtmlParserTest < ActiveSupport::TestCase
assert_equal "Text",
@parser.to_text('
Text')
end
+
+ def test_should_remove_space_of_beginning_of_line
+ str = <<~EOS
+
+
+ th1 |
+ th2 |
+
+
+ td1 |
+ td2 |
+
+
+ EOS
+
+ 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 5e083de7a1..5b0fb24b3f 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
@@ -29,4 +29,9 @@ class Redmine::WikiFormatting::MarkdownHtmlParserTest < ActiveSupport::TestCase
assert_equal 'A **simple** html snippet.',
@parser.to_text('A simple html snippet.
')
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 d55fd17ad6..b051aa4c54 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
@@ -29,4 +29,9 @@ class Redmine::WikiFormatting::TextileHtmlParserTest < ActiveSupport::TestCase
assert_equal 'A *simple* html snippet.',
@parser.to_text('A simple html snippet.
')
end
+
+ def test_html_tables_conversion
+ assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
+ @parser.to_text('')
+ end
end