Add support for custom emojis

Closes #14
pull/17/head
Alexey Golub 7 years ago
parent 2c0a63352c
commit 1d7264a71b

@ -116,4 +116,10 @@ div.msg-attachment {
img.msg-attachment { img.msg-attachment {
max-height: 500px; max-height: 500px;
max-width: 50%; max-width: 50%;
}
img.emoji {
height: 24px;
width: 24px;
vertical-align: -.4em;
} }

@ -114,4 +114,10 @@ div.msg-attachment {
img.msg-attachment { img.msg-attachment {
max-height: 500px; max-height: 500px;
max-width: 50%; max-width: 50%;
}
img.emoji {
height: 24px;
width: 24px;
vertical-align: -.4em;
} }

@ -248,6 +248,10 @@ namespace DiscordChatExporter.Services
// New lines // New lines
content = content.Replace("\n", "<br />"); content = content.Replace("\n", "<br />");
// Custom emojis (<:name:id>)
content = Regex.Replace(content, "&lt;:.*?:(\\d+)&gt;",
"<img class=\"emoji\" src=\"https://cdn.discordapp.com/emojis/$1.png\" />");
return content; return content;
} }
} }

Loading…
Cancel
Save