mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-23 08:09:41 +01:00
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? {
|
func renderURLAsHTML() -> String? {
|
||||||
guard let url = url else { return nil }
|
guard let url = url else { return nil }
|
||||||
|
|
||||||
if !url.hasPrefix("https://imgur.com"), let mediaEmbedContent = mediaEmbed?.content {
|
|
||||||
return mediaEmbedContent
|
|
||||||
}
|
|
||||||
|
|
||||||
if url.hasSuffix(".gif") {
|
if url.hasSuffix(".gif") {
|
||||||
return "<figure><img src=\"\(url)\"></figure>"
|
return "<figure><img src=\"\(url)\"></figure>"
|
||||||
}
|
}
|
||||||
@ -102,6 +98,10 @@ struct RedditLinkData: Codable {
|
|||||||
return html
|
return html
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let mediaEmbedContent = mediaEmbed?.content {
|
||||||
|
return mediaEmbedContent
|
||||||
|
}
|
||||||
|
|
||||||
if let imageSource = preview?.images?.first?.source, let imageURL = imageSource.url {
|
if let imageSource = preview?.images?.first?.source, let imageURL = imageSource.url {
|
||||||
var html = "<figure><a href=\"\(url)\"><img src=\"\(imageURL)\" "
|
var html = "<figure><a href=\"\(url)\"><img src=\"\(imageURL)\" "
|
||||||
if let width = imageSource.width, let height = imageSource.height {
|
if let width = imageSource.width, let height = imageSource.height {
|
||||||
|
Loading…
Reference in New Issue
Block a user