0
0
Fork 0

Enable to recognize most kinds of characters as URL paths (#4941)

This commit is contained in:
ふぁぼ原 2017-09-15 01:03:20 +09:00 committed by Eugen Rochko
parent b39d512ade
commit 3816943e6b
5 changed files with 96 additions and 5 deletions

View file

@ -131,7 +131,7 @@ class Formatter
end
def link_html(url)
url = Addressable::URI.parse(url).display_uri.to_s
url = Addressable::URI.parse(url).to_s
prefix = url.match(/\Ahttps?:\/\/(www\.)?/).to_s
text = url[prefix.length, 30]
suffix = url[prefix.length + 30..-1]