diff --git a/app/models/paste.rb b/app/models/paste.rb index 5cda49d..a0afad4 100644 --- a/app/models/paste.rb +++ b/app/models/paste.rb @@ -40,8 +40,12 @@ class Paste Pygments.highlight(contents, lexer: syntax, options: { linenos: 'table' }) end + def parsed_for_links + contents.gsub(/(https?:\/\/[\S]+)/, '\0') + end + def paragraph - "
#{contents}
" + "
#{parsed_for_links}
" end def html