mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-15 01:25:08 +00:00
Merge pull request #2936 from MathiusD/expand-link
Increase size of links displayed in video description
This commit is contained in:
@@ -383,3 +383,11 @@ def fetch_random_instance
|
||||
|
||||
return filtered_instance_list.sample(1)[0]
|
||||
end
|
||||
|
||||
def reduce_uri(uri : URI | String, max_length : Int32 = 50, suffix : String = "…") : String
|
||||
str = uri.to_s.sub(/^https?:\/\//, "")
|
||||
if str.size > max_length
|
||||
str = "#{str[0, max_length]}#{suffix}"
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user