Trim whitespace before replacing line breaks in unknown elements
| @@ -379,7 +379,7 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => { | ||
| 379 | 379 | |
| 380 | 380 | // Replace line breaks with <br> in unknown elements |
| 381 | 381 | if (node instanceof HTMLUnknownElement) { |
| 382 | 382 | node.innerHTML = node.innerHTML.trim().replaceAll('\n', '<br>'); |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | const isMediaAllowed = isExternalMediaAllowed(); |