From 9c8332bee64ecf22c5ae55b53eddfc20e747226b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=CE=94BL=C3=98=20=E1=84=83=CE=9E?= Date: Mon, 11 Sep 2023 00:43:10 -0500 Subject: [PATCH] UI: Code block fixes (#710) * fix: code block bad typo and margin * eslint * lint --------- Co-authored-by: pabl-o-ce --- web/src/app.css | 2 +- web/src/routes/chat/[id]/+page.svelte | 54 ++++++++++++--------------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/web/src/app.css b/web/src/app.css index 0c0d391..dab1455 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -14,7 +14,7 @@ padding: 4px; overflow-x: auto; overflow-wrap: break-word; - margin: 0.5rem 0; + margin: 0; width: auto; } diff --git a/web/src/routes/chat/[id]/+page.svelte b/web/src/routes/chat/[id]/+page.svelte index 2ca5b0a..ac91d3c 100644 --- a/web/src/routes/chat/[id]/+page.svelte +++ b/web/src/routes/chat/[id]/+page.svelte @@ -189,16 +189,7 @@ if (!originalFenceRenderer) throw new Error("originalFenceRenderer is undefined"); // Create copy button HTML - const copyButton = `
- -
`; + const copyButton = `
`; const codeBlock = originalFenceRenderer(tokens, index, options, env, self) .replace(` - - {#if i === history.length - 1 && !isLoading} -
- -
- {/if} + + + + + + {/if} + {:else if question.type === "ai"}