Merge pull request #2 from nimdraugsael/master

Links automaking for plain text
This commit is contained in:
Gregory Eremin
2013-07-29 06:54:33 -07:00
+5 -1
View File
@@ -40,8 +40,12 @@ class Paste
Pygments.highlight(contents, lexer: syntax, options: { linenos: 'table' })
end
def parsed_for_links
contents.gsub(/(https?:\/\/[\S]+)/, '<a target="_blank" href="\0">\0</a>')
end
def paragraph
"<pre>#{contents}</pre>"
"<pre>#{parsed_for_links}</pre>"
end
def html