diff --git a/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.svelte b/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.svelte index db8cf9c..4176c81 100644 --- a/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.svelte +++ b/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.svelte @@ -141,9 +141,13 @@ {#if form?.logId === id && form?.currentDiff} -
{@html DOMPurify.sanitize(form.currentDiff, {
- ALLOWED_TAGS: ["ins", "del"]
- })}
+ {@html DOMPurify.sanitize(
+ // .replace takes escaped text representations of line breaks and converts them to real line breaks that render correctly in HTML
+ form.currentDiff.replace(/\\r\\n|\\n|\\r/g, "\n"),
+ {
+ ALLOWED_TAGS: ["ins", "del"]
+ }
+ )}
{/if}
{/if}