aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-06-09 00:28:42 -0300
committerJosé Valim <jose.valim@gmail.com>2010-06-09 10:06:14 +0200
commit0919c0dbca3df02f5cfff7dde4f61b85ef16d886 (patch)
treead022ed8ac2b7bf94eeff03c365c3654da621426 /actionpack/lib/action_view
parentf48aa14bf43fb103e5d128151061549ba6bb8c23 (diff)
downloadrails-0919c0dbca3df02f5cfff7dde4f61b85ef16d886.tar.gz
rails-0919c0dbca3df02f5cfff7dde4f61b85ef16d886.tar.bz2
rails-0919c0dbca3df02f5cfff7dde4f61b85ef16d886.zip
Removed textilize, textilize_without_paragraph and markdown helpers
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb83
1 files changed, 0 insertions, 83 deletions
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].
- # <i>This method is only available if RedCloth[http://redcloth.org/] is available</i>.
- #
- # ==== Examples
- # textilize("*This is Textile!* Rejoice!")
- # # => "<p><strong>This is Textile!</strong> Rejoice!</p>"
- #
- # textilize("I _love_ ROR(Ruby on Rails)!")
- # # => "<p>I <em>love</em> <acronym title="Ruby on Rails">ROR</acronym>!</p>"
- #
- # textilize("h2. Textile makes markup -easy- simple!")
- # # => "<h2>Textile makes markup <del>easy</del> simple!</h2>"
- #
- # textilize("Visit the Rails website "here":http://www.rubyonrails.org/.)
- # # => "<p>Visit the Rails website <a href="http://www.rubyonrails.org/">here</a>.</p>"
- #
- # textilize("This is worded <strong>strongly</strong>")
- # # => "<p>This is worded <strong>strongly</strong></p>"
- #
- # textilize("This is worded <strong>strongly</strong>", :filter_html)
- # # => "<p>This is worded &lt;strong&gt;strongly&lt;/strong&gt;</p>"
- #
- 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 <p> tag that RedCloth adds.
- #
- # You can learn more about Textile's syntax at its website[http://www.textism.com/tools/textile].
- # <i>This method is only available if RedCloth[http://redcloth.org/] is available</i>.
- #
- # ==== 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>."
- def textilize_without_paragraph(text, *options)
- textiled = textilize(text, *options)
- 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
-
- # Returns the text with all the Markdown codes turned into HTML tags.
- # <i>This method requires BlueCloth[http://www.deveiate.org/projects/BlueCloth]
- # to be available</i>.
- #
- # ==== 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 <em>write</em> <code>code</code>, not just <em>read</em> it!</p>"
- #
- # markdown("The [Markdown website](http://daringfireball.net/projects/markdown/) has more information.")
- # # => "<p>The <a href="http://daringfireball.net/projects/markdown/">Markdown website</a>
- # # has more information.</p>"
- #
- # markdown('![The ROR logo](http://rubyonrails.com/images/rails.png "Ruby on Rails")')
- # # => '<p><img src="http://rubyonrails.com/images/rails.png" alt="The ROR logo" title="Ruby on Rails" /></p>'
- 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(<tt>\n\n</tt>) are considered as a
# paragraph and wrapped in <tt><p></tt> tags. One newline (<tt>\n</tt>) is