Try to make sure unclosed tags can’t hide enclosures.

This commit is contained in:
Brent Simmons committed 2026-10-23 10:47:24 -07:00
1 parent 73009b389c
commit 1a07f175d2
1 file changed
+5 -1
@@ -264,8 +264,12 @@ private extension ArticleRenderer {
if template().contains("[[enclosures]]") {
d["body"] = body
d["enclosures"] = enclosures
} else if enclosures.isEmpty {
d["body"] = body
} else {
d["body"] = body + enclosures
// The wrapper div closes anything the body leaves open, such as an unclosed
// <audio> (Micro.blog posts have them), so the enclosures can’t end up inside it.
d["body"] = "<div>" + body + "</div>" + enclosures
}
#if os(macOS)