diff --git a/Gemfile b/Gemfile index e91c56902b5e1303acf5dc17bd594b4dada022e6..acee230d23c1bf18eaf89a4f097bd96f1a22efe9 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,7 @@ end # AP gem "RedCloth", ">= 4.2.2" +gem "bluecloth", ">= 2.0.7" group :documentation do gem 'rdoc', '2.1' diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 19f55143bfb2c4e1f26f4e4f484eb83b6064a0c1..8f63845d4991e0cad0b85c110e7432869047bd75 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -298,8 +298,8 @@ def textilize_without_paragraph(text, *options) # # markdown('![The ROR logo](http://rubyonrails.com/images/rails.png "Ruby on Rails")') # # => '
We are using Markdown now!
", markdown("We are using __Markdown__ now!")) + end + + def test_markdown_with_blank + assert_equal("", markdown("")) + end + + def test_markdown_should_sanitize_unsafe_input + assert_equal("This is worded strongly
", markdown("This is worded strongly")) + end + + def test_markdown_should_not_sanitize_input_if_safe_option + assert_equal("This is worded strongly
", markdown("This is worded strongly", :safe)) + end + + def test_markdown_should_not_sanitize_safe_input + assert_equal("This is worded strongly
", markdown("This is worded strongly".html_safe)) + end + + def test_markdown_with_hard_breaks + assert_equal("This is one scary world.
\n\nTrue.
", markdown("This is one scary world.\n\nTrue.")) + end + end end