4 # Uses Text::Format to take the text and format it, indented two spaces for
5 # each line, and wrapped at 72 columns.
7 formatted
= text
.split(/\n\r\n/).collect
{ |paragraph
|
9 :columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph
13 # Make list points stand on their own line
14 formatted
.gsub
!(/[ ]*([*]+) ([^*]*)/) { |s
| " #{$1} #{$2.strip}\n" }
15 formatted
.gsub
!(/[ ]*([#]+) ([^#]*)/) { |s
| " #{$1} #{$2.strip}\n" }