2006-06-09から1日間の記事一覧

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:…