Skip to content

Commit 3702e8c

Browse files
authored
Fix comment "pings" (#3038)
1 parent 21bd4ed commit 3702e8c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/invidious/comments.cr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,13 @@ def content_to_comment_html(content)
602602
text = %(<a href="/watch?v=#{video_id}">#{"youtube.com/watch?v=#{video_id}"}</a>)
603603
end
604604
elsif url = run.dig?("navigationEndpoint", "commandMetadata", "webCommandMetadata", "url").try &.as_s
605-
text = %(<a href="#{url}">#{reduce_uri(url)}</a>)
605+
if text.starts_with?(/\s?@/)
606+
# Handle "pings" in comments differently
607+
# See: https://github.com/iv-org/invidious/issues/3038
608+
text = %(<a href="#{url}">#{text}</a>)
609+
else
610+
text = %(<a href="#{url}">#{reduce_uri(url)}</a>)
611+
end
606612
end
607613
end
608614

0 commit comments

Comments
 (0)