Trim whitespace before replacing line breaks in unknown elements

34c25300e59b2f77a75cfd3d715c4a13bd9e444f

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Ignore whitespace
public/script.js+1 -1
@@ -379,7 +379,7 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => {
379379
380380 // Replace line breaks with <br> in unknown elements
381381 if (node instanceof HTMLUnknownElement) {
382382 node.innerHTML = node.innerHTML.trim().replaceAll('\n', '<br>');
383383 }
384384
385385 const isMediaAllowed = isExternalMediaAllowed();