mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-04 03:08:43 +00:00
Use div instead of figure for enclosures.
This commit is contained in:
1 parent
876e0a0068
commit
badbb47030
2 files changed
+7
-6
No files matched your search
@@ -33,7 +33,7 @@ extension ArticleRenderer {
|
||||
}
|
||||
|
||||
if !hasVisualEnclosure, let imageURL, !imageURL.isEmpty, !bodyContainsVisualElement(body), !bodyContainsURL(body, imageURL) {
|
||||
let image = "<figure class=\"nnw-enclosure nnw-enclosure-image\"><img src=\"\(imageURL.escapingSpecialXMLCharacters)\" alt=\"\"></figure>"
|
||||
let image = "<div class=\"nnw-enclosure nnw-enclosure-image\"><img src=\"\(imageURL.escapingSpecialXMLCharacters)\" alt=\"\"></div>"
|
||||
enclosures.insert(image, at: 0)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ private extension ArticleRenderer {
|
||||
static func enclosureHTML(_ attachment: Attachment, posterURL: String?) -> String? {
|
||||
if let youTubeEmbedURL = ArticleRenderingSpecialCases.youTubeEmbedURL(forAttachmentURL: attachment.url) {
|
||||
let iframe = "<iframe src=\"\(youTubeEmbedURL)\"" + dimensionAttributes(attachment) + " allowfullscreen></iframe>"
|
||||
return "<figure class=\"nnw-enclosure nnw-enclosure-video\">\(iframe)</figure>"
|
||||
return "<div class=\"nnw-enclosure nnw-enclosure-video\">\(iframe)</div>"
|
||||
}
|
||||
|
||||
guard let displayMedium = attachment.displayMedium else {
|
||||
@@ -78,11 +78,11 @@ private extension ArticleRenderer {
|
||||
return nil
|
||||
}
|
||||
|
||||
var html = "<figure class=\"nnw-enclosure nnw-enclosure-\(displayMedium.rawValue)\">\(mediaElement)"
|
||||
var html = "<div class=\"nnw-enclosure nnw-enclosure-\(displayMedium.rawValue)\">\(mediaElement)"
|
||||
if let caption, !caption.isEmpty {
|
||||
html += "<figcaption>\(caption.escapingSpecialXMLCharacters)</figcaption>"
|
||||
html += "<div class=\"nnw-enclosure-caption\">\(caption.escapingSpecialXMLCharacters)</div>"
|
||||
}
|
||||
html += "</figure>"
|
||||
html += "</div>"
|
||||
return html
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,8 @@ img.twemoji, img.emoji {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.nnw-enclosure figcaption {
|
||||
.nnw-enclosure-caption {
|
||||
margin: 0.5em 0 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user