instance method
markdown
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
markdown(text)
Returns the text with all the Markdown codes turned into HTML tags. This method requires BlueCloth or another Markdown library to be installed..
==== Examples markdown(“We are using Markdown now!”) # => “<p>We are using <strong>Markdown</strong> now!</p>”
markdown(“We like to write code, not just read it!”) # => “<p>We like to write code, not just read it!</p>”
markdown(“The Markdown website has more information.”) # => “<p>The <a href=”daringfireball.net/projects/markdown/“>Markdown website</a> # has more information.</p>”
markdown(‘
ROR logo’) # => ‘<p><img src=“
” alt=“The ROR logo” title=“Ruby on Rails” /></p>’
Parameters
-
textreq
Source
# File actionpack/lib/action_view/helpers/text_helper.rb, line 299
def markdown(text)
text.blank? ? "" : Markdown.new(text).to_html
end
Defined in actionpack/lib/action_view/helpers/text_helper.rb line 299
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::TextHelper