From 3702e8c6fe5d36011ca596f7cbc174ceb62c9ee3 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 17 Apr 2022 18:02:47 +0200 Subject: [PATCH] Fix comment "pings" (#3038) --- src/invidious/comments.cr | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 66cbc4fc..002983ee 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -602,7 +602,13 @@ def content_to_comment_html(content) text = %(#{"youtube.com/watch?v=#{video_id}"}) end elsif url = run.dig?("navigationEndpoint", "commandMetadata", "webCommandMetadata", "url").try &.as_s - text = %(#{reduce_uri(url)}) + if text.starts_with?(/\s?@/) + # Handle "pings" in comments differently + # See: https://github.com/iv-org/invidious/issues/3038 + text = %(#{text}) + else + text = %(#{reduce_uri(url)}) + end end end