Use per-document setting for hardbreaks on textile

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@678 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 cdd2e844
......@@ -65,12 +65,11 @@ def pluralize(count, singular, plural = nil)
begin
require "redcloth"
class RedCloth; def hard_breaks() true end; end
# Returns the text with all the Textile codes turned into HTML-tags.
# <i>This method is only available if RedCloth can be required</i>.
def textilize(text)
text.empty? ? "" : RedCloth.new(text).to_html
text.empty? ? "" : RedCloth.new(text, [ :hard_breaks ]).to_html
end
# Returns the text with all the Textile codes turned into HTML-tags, but without the regular bounding <p> tag.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册