mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Merge pull request #3039 from iv-org/SamantazFox-patch-1
Fix comment "pings" (#3038)
This commit is contained in:
commit
aa07ee22cf
1 changed files with 7 additions and 1 deletions
|
@ -602,9 +602,15 @@ 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
|
||||||
|
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>)
|
text = %(<a href="#{url}">#{reduce_uri(url)}</a>)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
text
|
text
|
||||||
end.join("").delete('\ufeff')
|
end.join("").delete('\ufeff')
|
||||||
|
|
Loading…
Reference in a new issue