diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2022-05-01 17:42:53 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2022-05-01 17:42:53 +0200 |
| commit | 6a02dd88428491a4aad1ec80ed586826316cdf35 (patch) | |
| tree | 0d8b08dc2d6f1511c7e4c94353e4fe465061fff7 | |
| parent | 44348892700baceba50f8a133136fa569278c1b0 (diff) | |
| download | invidious-6a02dd88428491a4aad1ec80ed586826316cdf35.tar.gz invidious-6a02dd88428491a4aad1ec80ed586826316cdf35.tar.bz2 invidious-6a02dd88428491a4aad1ec80ed586826316cdf35.zip | |
Fix broken hashtag links
| -rw-r--r-- | src/invidious/comments.cr | 8 |
1 files 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 = %(<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 - 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 = %(<a href="#{url}">#{text}</a>) else text = %(<a href="#{url}">#{reduce_uri(url)}</a>) |
