mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-03 12:27:32 +01:00
Don't link to redd.it
This commit is contained in:
parent
cce420b31d
commit
a8f6b27c48
@ -116,7 +116,10 @@ struct RedditLinkData: Codable {
|
||||
}
|
||||
|
||||
func linkOutURL(_ url: String) -> String {
|
||||
guard let urlComponents = URLComponents(string: url), let host = urlComponents.host, !host.hasSuffix("reddit.com") else {
|
||||
guard let urlComponents = URLComponents(string: url), let host = urlComponents.host else {
|
||||
return ""
|
||||
}
|
||||
guard !host.hasSuffix("reddit.com") && !host.hasSuffix("redd.it") else {
|
||||
return ""
|
||||
}
|
||||
return "<div><a href=\"\(url)\">\(url)</a></div>"
|
||||
|
Loading…
x
Reference in New Issue
Block a user