fix comments using dig

This commit is contained in:
Emilien Devos 2021-08-12 19:57:22 +02:00
parent 88c5e3b6fa
commit 6745ca7775

View file

@ -570,7 +570,7 @@ def content_to_comment_html(content)
else
text = %(<a href="/watch?v=#{video_id}">#{text}</a>)
end
elsif url = run["navigationEndpoint"]["commandMetadata"]?.try &.["webCommandMetadata"]["url"].as_s
elsif url = run.dig?("navigationEndpoint", "commandMetadata", "webCommandMetadata", "url").try &.as_s
text = %(<a href="#{url}">#{text}</a>)
end
end