Skip to content

Instantly share code, notes, and snippets.

@nummi
Created February 19, 2010 19:53
Show Gist options
  • Save nummi/309132 to your computer and use it in GitHub Desktop.
Save nummi/309132 to your computer and use it in GitHub Desktop.
String.class_eval do
def create_links
self.gsub(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/, '<a href="\1" rel="external">\1</a>')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment