diff --git a/Account/Sources/Account/FeedProvider/Reddit/RedditLink.swift b/Account/Sources/Account/FeedProvider/Reddit/RedditLink.swift
index ff91ddca4..bdbebfac0 100644
--- a/Account/Sources/Account/FeedProvider/Reddit/RedditLink.swift
+++ b/Account/Sources/Account/FeedProvider/Reddit/RedditLink.swift
@@ -102,40 +102,38 @@ final class RedditLinkData: Codable {
}
if isVideo ?? false, let videoURL = media?.video?.hlsURL {
- var html = ""
+ html += "src=\"\(videoURL)\">"
return html
}
if let imageVariantURL = preview?.images?.first?.variants?.mp4?.source?.url {
- var html = ""
- html += linkURL(url)
+ html += "src=\"\(imageVariantURL)\" autoplay muted loop>"
return html
}
if let videoPreviewURL = preview?.videoPreview?.url {
- var html = ""
- html += linkURL(url)
+ html += "src=\"\(videoPreviewURL)\" autoplay muted loop>"
return html
}
@@ -144,15 +142,14 @@ final class RedditLinkData: Codable {
}
if let imageSource = preview?.images?.first?.source, let imageURL = imageSource.url {
- var html = ""
- html += linkURL(url, linkOutOnly: false)
+ html += ">"
return html
}
@@ -167,25 +164,10 @@ final class RedditLinkData: Codable {
html += ">"
}
}
- html += linkURL(url, linkOutOnly: false)
return html
}
- return linkURL(url)
- }
-
- func linkURL(_ url: String, linkOutOnly: Bool = true) -> String {
- guard let urlComponents = URLComponents(string: url), let host = urlComponents.host else {
- return ""
- }
- guard !linkOutOnly || (!host.hasSuffix("reddit.com") && !host.hasSuffix("redd.it")) else {
- return ""
- }
- var displayURL = "\(urlComponents.host ?? "")\(urlComponents.path)"
- if displayURL.count > 30 {
- displayURL = "\(displayURL.prefix(30))..."
- }
- return "