instance method markdown

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

markdown(text)

Returns the text with all the Markdown codes turned into HTML tags. This method is only available if BlueCloth is available.

==== 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(‘The ROR logo’) # => ‘<p><img src=“” alt=“The ROR logo” title=“Ruby on Rails” /></p>’

Parameters

text req
Source
# File actionpack/lib/action_view/helpers/text_helper.rb, line 309
        def markdown(text)
          text.blank? ? "" : BlueCloth.new(text).to_html
        end

Defined in actionpack/lib/action_view/helpers/text_helper.rb line 309 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionView::Helpers::TextHelper

Type at least 2 characters to search.

↑↓ navigate · open · esc close