mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-22 15:20:00 +01:00
Shorten link out URL's
This commit is contained in:
parent
38f992d01d
commit
73f9d750b7
@ -122,7 +122,11 @@ struct RedditLinkData: Codable {
|
||||
guard !host.hasSuffix("reddit.com") && !host.hasSuffix("redd.it") else {
|
||||
return ""
|
||||
}
|
||||
return "<div><a href=\"\(url)\">\(url)</a></div>"
|
||||
var displayURL = "\(urlComponents.host ?? "")\(urlComponents.path)"
|
||||
if displayURL.count > 30 {
|
||||
displayURL = "\(displayURL.prefix(30))..."
|
||||
}
|
||||
return "<div><a href=\"\(url)\">\(displayURL)</a></div>"
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user