instance method textilize_without_paragraph

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

textilize_without_paragraph(text)

Returns the text with all the Textile codes turned into HTML tags, but without the bounding <p> tag that RedCloth adds.

You can learn more about Textile’s syntax at its website. This method is only available if RedCloth is available.

Examples

textilize_without_paragraph("*This is Textile!*  Rejoice!")
# => "<strong>This is Textile!</strong>  Rejoice!"

textilize_without_paragraph("I _love_ ROR(Ruby on Rails)!")
# => "I <em>love</em> <acronym title="Ruby on Rails">ROR</acronym>!"

textilize_without_paragraph("h2. Textile makes markup -easy- simple!")
# => "<h2>Textile makes markup <del>easy</del> simple!</h2>"

textilize_without_paragraph("Visit the Rails website "here":http://www.rubyonrails.org/.)
# => "Visit the Rails website <a href="http://www.rubyonrails.org/">here</a>."

Parameters

text req
Source
# File actionpack/lib/action_view/helpers/text_helper.rb, line 279
        def textilize_without_paragraph(text)
          textiled = textilize(text)
          if textiled[0..2] == "<p>" then textiled = textiled[3..-1] end
          if textiled[-4..-1] == "</p>" then textiled = textiled[0..-5] end
          return textiled
        end

Defined in actionpack/lib/action_view/helpers/text_helper.rb line 279 · 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