From 7bad4c1ebccac83a4de2eef04cca6d641f75a523 Mon Sep 17 00:00:00 2001 From: andrzejber <149780348+andrzejber@users.noreply.github.com> Date: Fri, 7 Aug 2026 22:55:52 +0200 Subject: [PATCH] Avoid double-escaping custom emoji fallback --- src/invidious/videos/description.cr | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) << %()