diff --git a/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.server.ts b/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.server.ts
index 84d7473..e9ac293 100644
--- a/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.server.ts
+++ b/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.server.ts
@@ -80,17 +80,18 @@ export const actions: Actions = {
const htmlDiff = (oldValue: string, newValue: string) => {
const diff = dmp.diff_main(oldValue, newValue);
- dmp.diff_cleanupSemantic(diff);
return diff
.map(([op, text]) => {
+ const escapedText = text.replace(//g, ">");
+
switch (op) {
case 1:
- return `${text}`;
+ return `${escapedText}`;
case -1:
- return `${text}`;
+ return `${escapedText}`;
default:
- return text;
+ return escapedText;
}
})
.join("");
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 313e98b..328db02 100644
--- a/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.svelte
+++ b/web-app/src/routes/(authenticated)/website/[websiteId]/logs/+page.svelte
@@ -141,24 +141,20 @@
{#if form?.logId === id && form?.currentDiff}
-
{@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").replace(/\\\"/g, '"'),
- {
- ALLOWED_TAGS: ["ins", "del"]
- }
- )}
+ {@html form.currentDiff
+ .replace(/\\\"/g, '"')
+ .replace(/\\r\\n|\\n|\\r/g, "\n")}
{/if}
{/if}
{#if new_value && !old_value}
{DOMPurify.sanitize(newValue)}
+ {newValue.replace(/\\\"/g, '"').replace(/\\r\\n|\\n|\\r/g, "\n")}
{/if}
{#if old_value && !new_value}
{DOMPurify.sanitize(oldValue)}
+ {oldValue.replace(/\\\"/g, '"').replace(/\\r\\n|\\n|\\r/g, "\n")}
{/if}