mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-05 21:46:49 +01:00
DOM.purify toast if HTML is allowed
This commit is contained in:
parent
0d9843cdd6
commit
25d8286dfc
@ -2251,6 +2251,11 @@ async function echoCallback(args, value) {
|
||||
}
|
||||
}
|
||||
|
||||
// If we allow HTML, we need to sanitize it to prevent security risks
|
||||
if (!options.escapeHtml) {
|
||||
value = DOMPurify.sanitize(value, { FORBID_TAGS: ['style'] });
|
||||
}
|
||||
|
||||
let toast;
|
||||
switch (severity) {
|
||||
case 'error':
|
||||
|
Loading…
Reference in New Issue
Block a user