From 0919c0dbca3df02f5cfff7dde4f61b85ef16d886 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 9 Jun 2010 00:28:42 -0300 Subject: Removed textilize, textilize_without_paragraph and markdown helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionpack/lib/action_view/helpers/text_helper.rb | 83 ----------------------- 1 file changed, 83 deletions(-) (limited to 'actionpack/lib/action_view/helpers/text_helper.rb') diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 8f63845d49..a06073ce66 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -220,89 +220,6 @@ module ActionView end * "\n" end - # Returns the text with all the Textile[http://www.textism.com/tools/textile] codes turned into HTML tags. - # - # You can learn more about Textile's syntax at its website[http://www.textism.com/tools/textile]. - # This method is only available if RedCloth[http://redcloth.org/] is available. - # - # ==== Examples - # textilize("*This is Textile!* Rejoice!") - # # => "

This is Textile! Rejoice!

" - # - # textilize("I _love_ ROR(Ruby on Rails)!") - # # => "

I love ROR!

" - # - # textilize("h2. Textile makes markup -easy- simple!") - # # => "

Textile makes markup easy simple!

" - # - # textilize("Visit the Rails website "here":http://www.rubyonrails.org/.) - # # => "

Visit the Rails website here.

" - # - # textilize("This is worded strongly") - # # => "

This is worded strongly

" - # - # textilize("This is worded strongly", :filter_html) - # # => "

This is worded <strong>strongly</strong>

" - # - def textilize(text, *options) - options ||= [:hard_breaks] - text = sanitize(text) unless text.html_safe? || options.delete(:safe) - - if text.blank? - "" - else - textilized = RedCloth.new(text, options) - textilized.to_html - end.html_safe - end - - # Returns the text with all the Textile codes turned into HTML tags, - # but without the bounding

tag that RedCloth adds. - # - # You can learn more about Textile's syntax at its website[http://www.textism.com/tools/textile]. - # This method is only available if RedCloth[http://redcloth.org/] is available. - # - # ==== Examples - # textilize_without_paragraph("*This is Textile!* Rejoice!") - # # => "This is Textile! Rejoice!" - # - # textilize_without_paragraph("I _love_ ROR(Ruby on Rails)!") - # # => "I love ROR!" - # - # textilize_without_paragraph("h2. Textile makes markup -easy- simple!") - # # => "

Textile makes markup easy simple!

" - # - # textilize_without_paragraph("Visit the Rails website "here":http://www.rubyonrails.org/.) - # # => "Visit the Rails website here." - def textilize_without_paragraph(text, *options) - textiled = textilize(text, *options) - if textiled[0..2] == "

" then textiled = textiled[3..-1] end - if textiled[-4..-1] == "

" then textiled = textiled[0..-5] end - return textiled - end - - # Returns the text with all the Markdown codes turned into HTML tags. - # This method requires BlueCloth[http://www.deveiate.org/projects/BlueCloth] - # to be available. - # - # ==== Examples - # markdown("We are using __Markdown__ now!") - # # => "

We are using Markdown now!

" - # - # markdown("We like to _write_ `code`, not just _read_ it!") - # # => "

We like to write code, not just read it!

" - # - # markdown("The [Markdown website](http://daringfireball.net/projects/markdown/) has more information.") - # # => "

The Markdown website - # # has more information.

" - # - # markdown('![The ROR logo](http://rubyonrails.com/images/rails.png "Ruby on Rails")') - # # => '

The ROR logo

' - def markdown(text, *options) - text = sanitize(text) unless text.html_safe? || options.delete(:safe) - (text.blank? ? "" : BlueCloth.new(text).to_html).html_safe - end - # Returns +text+ transformed into HTML using simple formatting rules. # Two or more consecutive newlines(\n\n) are considered as a # paragraph and wrapped in

tags. One newline (\n) is -- cgit v1.2.3