This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy/paste of simple_format from Rails but with <p> removed. | |
def simpler_format(text, html_options={}, options={}) | |
text = ''.html_safe if text.nil? | |
text = sanitize(text) unless options[:sanitize] == false | |
text = String.new(text) | |
text.gsub!(/\r\n?/, "\n") | |
text.gsub!(/\n\n+/, "<br /><br />") | |
text.gsub!(/\n/, "<br />") | |
text = ActiveSupport::SafeBuffer.new(text).safe_concat("<br />").html_safe | |
end |