Skip to content

Commit

Permalink
Credit Allan Odgaard for the text-wrapping method in the lessons stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
danbernier committed Sep 28, 2011
1 parent 5936aaa commit ef2f06b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lessons/lesson-md-gen.rbx
Expand Up @@ -30,9 +30,9 @@ module MarkdownTranslator
yield
end

# via http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
def wrap_text(txt, col = 80)
txt.gsub(/(.{1,#{col}})( +|$\n?)|(.{1,#{col}})/,
"\\1\\3\n")
txt.gsub(/(.{1,#{col}})( +|$\n?)|(.{1,#{col}})/, "\\1\\3\n")
end

def para *lines
Expand Down

0 comments on commit ef2f06b

Please sign in to comment.