mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-23 07:51:18 +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;
|
let toast;
|
||||||
switch (severity) {
|
switch (severity) {
|
||||||
case 'error':
|
case 'error':
|
||||||
|
Loading…
Reference in New Issue
Block a user