mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-10 17:15:43 +02:00
Add support for custom emoji in the viewer
This commit is contained in:
parent
4c9539d98a
commit
889403bc0d
src/renderer
@ -14,7 +14,8 @@ var DISCORD = (function(){
|
||||
specialUnescaped: /([*_~\\])/g,
|
||||
mentionRole: /<@&(\d+?)>/g,
|
||||
mentionUser: /<@!?(\d+?)>/g,
|
||||
mentionChannel: /<#(\d+?)>/g
|
||||
mentionChannel: /<#(\d+?)>/g,
|
||||
customEmoji: /<:([^:]+):(\d+?)>/g
|
||||
};
|
||||
|
||||
var isImageAttachment = function(attachment){
|
||||
@ -121,7 +122,8 @@ var DISCORD = (function(){
|
||||
processed = processed
|
||||
.replace(REGEX.formatUrl, "<a href='$1' target='_blank' rel='noreferrer'>$1</a>")
|
||||
.replace(REGEX.mentionChannel, (full, match) => "<span class='link mention-chat'>#"+STATE.getChannelName(match)+"</span>")
|
||||
.replace(REGEX.mentionUser, (full, match) => "<span class='link mention-user'>@"+STATE.getUserName(match)+"</span>");
|
||||
.replace(REGEX.mentionUser, (full, match) => "<span class='link mention-user'>@"+STATE.getUserName(match)+"</span>")
|
||||
.replace(REGEX.customEmoji, "<img src='https://cdn.discordapp.com/emojis/$2.png' alt=':$1:' title=':$1:' class='emoji'>");
|
||||
|
||||
return "<p>"+processed+"</p>";
|
||||
}
|
||||
|
@ -119,3 +119,11 @@
|
||||
margin-top: 6px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.message .emoji {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
margin: 0 1px;
|
||||
vertical-align: -30%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user