Fix comment "pings" (#3038)

pull/3039/head
Samantaz Fox 3 years ago committed by GitHub
parent 21bd4edee4
commit 3702e8c6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -602,7 +602,13 @@ def content_to_comment_html(content)
text = %(<a href="/watch?v=#{video_id}">#{"youtube.com/watch?v=#{video_id}"}</a>) text = %(<a href="/watch?v=#{video_id}">#{"youtube.com/watch?v=#{video_id}"}</a>)
end end
elsif url = run.dig?("navigationEndpoint", "commandMetadata", "webCommandMetadata", "url").try &.as_s elsif url = run.dig?("navigationEndpoint", "commandMetadata", "webCommandMetadata", "url").try &.as_s
text = %(<a href="#{url}">#{reduce_uri(url)}</a>) if text.starts_with?(/\s?@/)
# Handle "pings" in comments differently
# See: https://github.com/iv-org/invidious/issues/3038
text = %(<a href="#{url}">#{text}</a>)
else
text = %(<a href="#{url}">#{reduce_uri(url)}</a>)
end
end end
end end

Loading…
Cancel
Save