Links automaking for plain text
This commit is contained in:
parent
78aed88570
commit
0118753bdc
|
@ -40,8 +40,12 @@ class Paste
|
||||||
Pygments.highlight(contents, lexer: syntax, options: { linenos: 'table' })
|
Pygments.highlight(contents, lexer: syntax, options: { linenos: 'table' })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def parsed_for_links
|
||||||
|
contents.gsub(/(https?:\/\/[\S]+)/, '<a target="_blank" href="\0">\0</a>')
|
||||||
|
end
|
||||||
|
|
||||||
def paragraph
|
def paragraph
|
||||||
"<pre>#{contents}</pre>"
|
"<pre>#{parsed_for_links}</pre>"
|
||||||
end
|
end
|
||||||
|
|
||||||
def html
|
def html
|
||||||
|
|
Loading…
Reference in New Issue