diff options
author | Go MAEDA <maeda@farend.jp> | 2019-08-11 05:01:37 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-08-11 05:01:37 +0000 |
commit | f5c7a4a4208c9c146544b4498de3a08761cbc55a (patch) | |
tree | 8612620b530885d8e69b3c122281312b35255e31 /test | |
parent | 3c91a3d5b2f9a2ce55b941ee68fbaa596b5b3052 (diff) | |
download | redmine-f5c7a4a4208c9c146544b4498de3a08761cbc55a.tar.gz redmine-f5c7a4a4208c9c146544b4498de3a08761cbc55a.zip |
Convert HTML links to Textile/Markdown links when creating an issue from an email (#31695).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18361 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb | 5 | ||||
-rw-r--r-- | test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb | 5 |
2 files changed, 10 insertions, 0 deletions
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 63fc4ae5c..6a4b77387 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 @@ -28,5 +28,10 @@ class Redmine::WikiFormatting::MarkdownHtmlParserTest < ActiveSupport::TestCase def test_should_convert_tags assert_equal 'A **simple** html snippet.', @parser.to_text('<p>A <b>simple</b> html snippet.</p>') + + assert_equal 'foo [bar](http://example.com/) baz', + @parser.to_text('foo<a href="http://example.com/">bar</a>baz') + assert_equal 'foo http://example.com/ baz', + @parser.to_text('foo<a href="http://example.com/"></a>baz') 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 8d6f78689..a338ed528 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 @@ -28,5 +28,10 @@ class Redmine::WikiFormatting::TextileHtmlParserTest < ActiveSupport::TestCase def test_should_convert_tags assert_equal 'A *simple* html snippet.', @parser.to_text('<p>A <b>simple</b> html snippet.</p>') + + assert_equal 'foo "bar":http://example.com/ baz', + @parser.to_text('foo<a href="http://example.com/">bar</a>baz') + assert_equal 'foo http://example.com/ baz', + @parser.to_text('foo<a href="http://example.com/"></a>baz') end end |