simple_format

railsの html_line_break っぽいもの。

うーん、便利化したものを再実装すべきかな・・・

122: def simple_format(text)
123: text.gsub!(/(\r\n|\n|\r)/, "\n") # lets make them newlines crossplatform
124: text.gsub!(/\n\n+/, "\n\n") # zap dupes
125: text.gsub!(/\n\n/, '

\0

') # turn two newlines into paragraph
126: text.gsub!(/([^\n])(\n)([^\n])/, '\1\2
\3') # turn single newline into

127:
128: content_tag("p", text)
129: end


http://rails.rubyonrails.com/classes/ActionView/Helpers/TextHelper.html
http://wota.jp/ac/?date=20050823