Skip to content

Instantly share code, notes, and snippets.

@legkvla
Created April 10, 2014 11:59
Show Gist options
  • Save legkvla/10373855 to your computer and use it in GitHub Desktop.
Save legkvla/10373855 to your computer and use it in GitHub Desktop.
Fixing textile - end of bullets
before = "* Ruby\nHello world"
puts "Before: #{before}"
res = before.gsub(/\*.+\n+\s*[^\*]/) {|c| c.gsub(/\n+\s*/, "\n\n") }
puts "After: #{res}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment