From affa6568d6b2cb3cbe22663c4c78a6ab1c9a19d9 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 1 Jan 2024 10:35:46 -0800 Subject: [PATCH] fix: code render issue --- src/app.css | 2 +- src/lib/components/chat/Messages/ResponseMessage.svelte | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.css b/src/app.css index 34621fde..9665d026 100644 --- a/src/app.css +++ b/src/app.css @@ -16,7 +16,7 @@ html { code { /* white-space-collapse: preserve !important; */ - white-space: pre; + overflow-x: auto; width: auto; } diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index bb81b2c9..6f821b46 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -88,6 +88,7 @@ let code = block.querySelector('code'); code.style.borderTopRightRadius = 0; code.style.borderTopLeftRadius = 0; + code.style.whiteSpace = 'pre'; let topBarDiv = document.createElement('div'); topBarDiv.style.backgroundColor = '#202123';