Increase size of links displayed in video description

This commit is contained in:
Féry Mathieu (Mathius)
2022-02-25 02:11:30 +01:00
parent bf599284ed
commit 78c447829a
2 changed files with 14 additions and 3 deletions

View File

@@ -587,7 +587,7 @@ def content_to_comment_html(content)
end
end
text = %(<a href="#{url}">#{text}</a>)
text = %(<a href="#{url}">#{reduce_uri(url)}</a>)
elsif watch_endpoint = run["navigationEndpoint"]["watchEndpoint"]?
length_seconds = watch_endpoint["startTimeSeconds"]?
video_id = watch_endpoint["videoId"].as_s
@@ -595,10 +595,10 @@ def content_to_comment_html(content)
if length_seconds && length_seconds.as_i > 0
text = %(<a href="javascript:void(0)" data-onclick="jump_to_time" data-jump-time="#{length_seconds}">#{text}</a>)
else
text = %(<a href="/watch?v=#{video_id}">#{text}</a>)
text = %(<a href="/watch?v=#{video_id}">#{reduce_uri("/watch?v=#{video_id}")}</a>)
end
elsif url = run.dig?("navigationEndpoint", "commandMetadata", "webCommandMetadata", "url").try &.as_s
text = %(<a href="#{url}">#{text}</a>)
text = %(<a href="#{url}">#{reduce_uri(url)}</a>)
end
end