diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2022-04-17 23:34:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-17 23:34:38 +0200 |
| commit | aa07ee22cf329e1f537ec2e571275f5b2dc659a7 (patch) | |
| tree | 6971cd4c02149c6060d44a0b23629c5f574e7120 | |
| parent | 21bd4edee480e09f7e1dfc2659f60327b35f502d (diff) | |
| parent | 3702e8c6fe5d36011ca596f7cbc174ceb62c9ee3 (diff) | |
| download | invidious-aa07ee22cf329e1f537ec2e571275f5b2dc659a7.tar.gz invidious-aa07ee22cf329e1f537ec2e571275f5b2dc659a7.tar.bz2 invidious-aa07ee22cf329e1f537ec2e571275f5b2dc659a7.zip | |
Merge pull request #3039 from iv-org/SamantazFox-patch-1
Fix comment "pings" (#3038)
| -rw-r--r-- | src/invidious/comments.cr | 8 |
1 files changed, 7 insertions, 1 deletions
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 = %(<a href="/watch?v=#{video_id}">#{"youtube.com/watch?v=#{video_id}"}</a>) end 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 |
