Change media embed priority to be lower than video previews
This commit is contained in:
parent
73f9d750b7
commit
9e235564af
|
@ -69,10 +69,6 @@ struct RedditLinkData: Codable {
|
|||
func renderURLAsHTML() -> String? {
|
||||
guard let url = url else { return nil }
|
||||
|
||||
if !url.hasPrefix("https://imgur.com"), let mediaEmbedContent = mediaEmbed?.content {
|
||||
return mediaEmbedContent
|
||||
}
|
||||
|
||||
if url.hasSuffix(".gif") {
|
||||
return "<figure><img src=\"\(url)\"></figure>"
|
||||
}
|
||||
|
@ -102,6 +98,10 @@ struct RedditLinkData: Codable {
|
|||
return html
|
||||
}
|
||||
|
||||
if let mediaEmbedContent = mediaEmbed?.content {
|
||||
return mediaEmbedContent
|
||||
}
|
||||
|
||||
if let imageSource = preview?.images?.first?.source, let imageURL = imageSource.url {
|
||||
var html = "<figure><a href=\"\(url)\"><img src=\"\(imageURL)\" "
|
||||
if let width = imageSource.width, let height = imageSource.height {
|
||||
|
|
Loading…
Reference in New Issue