diff --git a/src/invidious/videos/description.cr b/src/invidious/videos/description.cr index 74bcc4baf..0ff18756a 100644 --- a/src/invidious/videos/description.cr +++ b/src/invidious/videos/description.cr @@ -59,14 +59,18 @@ private def render_description_attachment(attachment : JSON::Any, fallback : Str # same request path through yt3.ggpht.com. return unless {"lh3.googleusercontent.com", "yt3.ggpht.com"}.includes?(uri.host) - label = attachment.dig?("properties", "accessibilityProperties", "label").try &.as_s? || fallback + label = if raw_label = attachment.dig?("properties", "accessibilityProperties", "label").try &.as_s? + HTML.escape(raw_label) + else + fallback + end width = source["width"]?.try &.as_i? || 16_i64 height = source["height"]?.try &.as_i? || 16_i64 String.build do |str| - str << %() << HTML.escape(label) << %()