Enable to recognize most kinds of characters as URL paths (#4941)
This commit is contained in:
parent
b39d512ade
commit
3816943e6b
5 changed files with 96 additions and 5 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue