mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#2210 Replace line breaks with <br> in unknown elements
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user