instance method
textilize_without_paragraph
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available 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 requires RedCloth to be 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
-
textreq
Source
# File actionpack/lib/action_view/helpers/text_helper.rb, line 275
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 275
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::TextHelper