Skip to content

Commit a147bec

Browse files
committed
Move from referencing the BlueCloth constant directly, to referencing Markdown.
This supports alternative implementations of markdown such as rpeg-markdown or rdiscount, and later releases of bluecloth. There are some performance issues with earlier releases of bluecloth, and you should probably upgrade. In the event that you can't you can place the following code into an initializer: Markdown = BlueCloth
1 parent b3ec7b2 commit a147bec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

actionpack/lib/action_view/helpers/text_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ def textilize_without_paragraph(text)
271271
end
272272

273273
# Returns the text with all the Markdown codes turned into HTML tags.
274-
# <i>This method requires BlueCloth[http://www.deveiate.org/projects/BlueCloth]
275-
# to be available</i>.
274+
# <i>This method requires BlueCloth[http://www.deveiate.org/projects/BlueCloth] or another
275+
# Markdown library to be installed.</i>.
276276
#
277277
# ==== Examples
278278
# markdown("We are using __Markdown__ now!")
@@ -288,7 +288,7 @@ def textilize_without_paragraph(text)
288288
# markdown('![The ROR logo](http://rubyonrails.com/images/rails.png "Ruby on Rails")')
289289
# # => '<p><img src="http://rubyonrails.com/images/rails.png" alt="The ROR logo" title="Ruby on Rails" /></p>'
290290
def markdown(text)
291-
text.blank? ? "" : BlueCloth.new(text).to_html
291+
text.blank? ? "" : Markdown.new(text).to_html
292292
end
293293

294294
# Returns +text+ transformed into HTML using simple formatting rules.

0 commit comments

Comments
 (0)