From ce80b5e42c172a0b5c0543ca2df89997b870aed2 Mon Sep 17 00:00:00 2001 From: andrzejber <149780348+andrzejber@users.noreply.github.com> Date: Fri, 7 Aug 2026 22:24:10 +0200 Subject: [PATCH] Test invalid custom emoji URL fallback --- spec/invidious/videos/description_spec.cr | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/invidious/videos/description_spec.cr b/spec/invidious/videos/description_spec.cr index 054e5ca66..e6ca7603b 100644 --- a/spec/invidious/videos/description_spec.cr +++ b/spec/invidious/videos/description_spec.cr @@ -83,6 +83,24 @@ Spectator.describe "parse_description" do expect(parse_description(description, "video-id")).to eq("before <:custom:> after") end + it "preserves the escaped shortcode when an attachment source URL is invalid" do + description = JSON.parse(%({ + "content":"before <:custom:> after", + "attachmentRuns":[{ + "startIndex":8, + "length":8, + "element":{"type":{"imageType":{"image":{"sources":[{ + "url":"https://lh3.googleusercontent.com:invalid/custom.png", + "width":16, + "height":16 + }]}}}}, + "properties":{"accessibilityProperties":{"label":"custom"}} + }] + })) + + expect(parse_description(description, "video-id")).to eq("before <:custom:> after") + end + it "escapes attachment labels before inserting them into HTML" do description = JSON.parse(%({ "content":":custom:",