mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-16 11:51:25 +00:00
Parse links in the comments
Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
@@ -64,15 +64,15 @@ def content_to_comment_html(content, video_id : String? = "")
|
||||
# check for custom emojis
|
||||
if run["emoji"]?
|
||||
if run["emoji"]["isCustomEmoji"]?.try &.as_bool
|
||||
if emojiImage = run.dig?("emoji", "image")
|
||||
emojiAlt = emojiImage.dig?("accessibility", "accessibilityData", "label").try &.as_s || text
|
||||
emojiThumb = emojiImage["thumbnails"][0]
|
||||
if emoji_image = run.dig?("emoji", "image")
|
||||
emoji_alt = emoji_image.dig?("accessibility", "accessibilityData", "label").try &.as_s || text
|
||||
emoji_thumb = emoji_image["thumbnails"][0]
|
||||
text = String.build do |str|
|
||||
str << %(<img alt=") << emojiAlt << "\" "
|
||||
str << %(src="/ggpht) << URI.parse(emojiThumb["url"].as_s).request_target << "\" "
|
||||
str << %(title=") << emojiAlt << "\" "
|
||||
str << %(width=") << emojiThumb["width"] << "\" "
|
||||
str << %(height=") << emojiThumb["height"] << "\" "
|
||||
str << %(<img alt=") << emoji_alt << "\" "
|
||||
str << %(src="/ggpht) << URI.parse(emoji_thumb["url"].as_s).request_target << "\" "
|
||||
str << %(title=") << emoji_alt << "\" "
|
||||
str << %(width=") << emoji_thumb["width"] << "\" "
|
||||
str << %(height=") << emoji_thumb["height"] << "\" "
|
||||
str << %(class="channel-emoji" />)
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user