mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-12 10:00:36 +01:00
#2210 Replace line breaks with <br> in unknown elements
This commit is contained in:
parent
07a6cb1252
commit
e17a18ad5d
@ -288,6 +288,11 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Replace line breaks with <br> in unknown elements
|
||||
if (node instanceof HTMLUnknownElement) {
|
||||
node.innerHTML = node.innerHTML.replaceAll('\n', '<br>');
|
||||
}
|
||||
|
||||
const isMediaAllowed = isExternalMediaAllowed();
|
||||
if (isMediaAllowed) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user