mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-07 09:33:04 -05:00
Test invalid custom emoji URL fallback
This commit is contained in:
parent
bdf3ee5d0e
commit
ce80b5e42c
@ -83,6 +83,24 @@ Spectator.describe "parse_description" do
|
|||||||
expect(parse_description(description, "video-id")).to eq("before <:custom:> after")
|
expect(parse_description(description, "video-id")).to eq("before <:custom:> after")
|
||||||
end
|
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
|
it "escapes attachment labels before inserting them into HTML" do
|
||||||
description = JSON.parse(%({
|
description = JSON.parse(%({
|
||||||
"content":":custom:",
|
"content":":custom:",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user