From 6a02dd88428491a4aad1ec80ed586826316cdf35 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 1 May 2022 17:42:53 +0200 Subject: [PATCH] Fix broken hashtag links --- src/invidious/comments.cr | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index c6e7fd17..71c16eb4 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -602,9 +602,11 @@ 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 - if text.starts_with?(/\s?@/) - # Handle "pings" in comments differently - # See: https://github.com/iv-org/invidious/issues/3038 + if text.starts_with?(/\s?[@#]/) + # Handle "pings" in comments and hasthags differently + # See: + # - https://github.com/iv-org/invidious/issues/3038 + # - https://github.com/iv-org/invidious/issues/3062 text = %(#{text}) else text = %(#{reduce_uri(url)})