Make emojis larger if they are the only thing in content

This commit is contained in:
Alexey Golub 2018-06-28 00:29:47 +03:00
parent 49f39c7097
commit 3f5f62585c

View file

@ -221,8 +221,10 @@ namespace DiscordChatExporter.Core.Services
}
// Custom emojis (<:name:id>)
var isJumboable = Regex.Replace(content, "&lt;(:.*?:)(\\d*)&gt;", "").IsBlank();
var emojiClass = isJumboable ? "emoji emoji--large" : "emoji";
content = Regex.Replace(content, "&lt;(:.*?:)(\\d*)&gt;",
"<img class=\"emoji\" title=\"$1\" src=\"https://cdn.discordapp.com/emojis/$2.png\" />");
$"<img class=\"{emojiClass}\" title=\"$1\" src=\"https://cdn.discordapp.com/emojis/$2.png\" />");
return content;
}