Fix broken hashtag links

このコミットが含まれているのは:
Samantaz Fox 2022-05-01 17:42:53 +02:00
コミット 6a02dd8842
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: F42821059186176E
1個のファイルの変更5行の追加3行の削除

ファイルの表示

@ -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>)