Revisions
-
Evan David Light revised this gist
Jul 9, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,5 +6,5 @@ def simpler_format(text, html_options={}, options={}) text.gsub!(/\n\n+/, "<br /><br />") text.gsub!(/\n/, "<br />") text.concat!("<br />") text.html_safe end -
Evan David Light revised this gist
Jul 9, 2011 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ def simpler_format(text, html_options={}, options={}) text = text ? String.new(text) : '' text = sanitize(text) unless options[:sanitize] == false text = text.gsub(/\r\n?/, "\n") text.gsub!(/\n\n+/, "<br /><br />") text.gsub!(/\n/, "<br />") text.concat!("<br />") text = ActiveSupport::SafeBuffer.new(text).html_safe end -
Evan David Light revised this gist
Jul 9, 2011 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,9 @@ def simpler_format(text, html_options={}, options={}) text = text ? String.new(text) : '' text = sanitize(text) unless options[:sanitize] == false text.gsub(/\r\n?/, "\n"). gsub!(/\n\n+/, "<br /><br />"). gsub!(/\n/, "<br />"). concat!("<br />"). html_safe end -
Evan David Light revised this gist
Jul 9, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ def simpler_format(text, html_options={}, options={}) text = text ? String.new(text) : '' text = sanitize(text) unless options[:sanitize] == false 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 -
Evan David Light revised this gist
Jul 8, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Copy/paste of simple_format from Rails but with <p> removed. def simpler_format(text, html_options={}, options={}) text = text ? String.new(text) : '' text = sanitize(text) unless options[:sanitize] == false text.gsub!(/\r\n?/, "\n") text.gsub!(/\n\n+/, "<br /><br />") -
Evan David Light revised this gist
Jul 8, 2011 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,7 @@ # Copy/paste of simple_format from Rails but with <p> removed. def simpler_format(text, html_options={}, options={}) text = '' if text.nil? text = sanitize(text) unless options[:sanitize] == false text.gsub!(/\r\n?/, "\n") text.gsub!(/\n\n+/, "<br /><br />") text.gsub!(/\n/, "<br />") -
samanthachui renamed this gist
Jul 8, 2011 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ # Copy/paste of simple_format from Rails but with <p> removed. def simpler_format(text, html_options={}, options={}) text = ''.html_safe if text.nil? -
samanthachui created this gist
Jul 8, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # 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