mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-06-16 15:22:15 +03:00
Add message HTML escaping to renderer
This commit is contained in:
parent
06f8ba529c
commit
42789dcf7b
@ -7,9 +7,9 @@ var DISCORD = (function(){
|
||||
formatCodeInline: /`+\s*([\s\S]*?[^`])\s*\1(?!`)/g,
|
||||
formatCodeBlock: /```(?:([A-z0-9\-]+?)\n+)?\n*([^]+?)\n*```/g,
|
||||
formatUrl: /<?(\b(?:https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])>?/ig,
|
||||
mentionRole: /<@&(\d+?)>/g,
|
||||
mentionUser: /<@!?(\d+?)>/g,
|
||||
mentionChannel: /<#(\d+?)>/g
|
||||
mentionRole: /<@&(\d+?)>/g,
|
||||
mentionUser: /<@!?(\d+?)>/g,
|
||||
mentionChannel: /<#(\d+?)>/g
|
||||
};
|
||||
|
||||
var templateChannelServer;
|
||||
@ -59,7 +59,7 @@ var DISCORD = (function(){
|
||||
return date.toLocaleDateString()+", "+date.toLocaleTimeString();
|
||||
}
|
||||
else if (property === "contents"){
|
||||
var processed = value // TODO handle escaping
|
||||
var processed = DOM.escapeHTML(value)
|
||||
.replace(REGEX.formatBold, "<b>$1</b>")
|
||||
.replace(REGEX.formatItalic, "<i>$1</i>")
|
||||
.replace(REGEX.formatUnderline, "<u>$1</u>")
|
||||
|
Loading…
x
Reference in New Issue
Block a user