Skip to content

Commit

Permalink
fix: add extra space between paragraphs in reasoning renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed Dec 3, 2024
1 parent feecc17 commit 3d500d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
24 changes: 10 additions & 14 deletions src/lib/components/chat/MarkdownRenderer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,16 @@
});
</script>

<div
class="prose max-w-none dark:prose-invert max-sm:prose-sm prose-headings:font-semibold prose-h1:text-lg prose-h2:text-base prose-h3:text-base prose-pre:bg-gray-800 dark:prose-pre:bg-gray-900"
>
{#each marked.lexer(content) as token}
{#if token.type === "code"}
<CodeBlock lang={token.lang} code={token.text} />
{:else}
{#await marked.parse(token.raw) then parsed}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html parsed}
{/await}
{/if}
{/each}
</div>
{#each marked.lexer(content) as token}
{#if token.type === "code"}
<CodeBlock lang={token.lang} code={token.text} />
{:else}
{#await marked.parse(token.raw) then parsed}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html parsed}
{/await}
{/if}
{/each}

<style lang="postcss">
:global(.katex-display) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/chat/OpenReasoningResults.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</summary>

<div
class="border-t border-gray-200 px-5 pb-2 pt-2 text-sm text-gray-600 dark:border-gray-800 dark:text-gray-400"
class="border-t border-gray-200 px-5 pb-2 pt-2 text-sm text-gray-600 dark:border-gray-800 dark:text-gray-400 space-y-4"
>
<MarkdownRenderer {content} />
</div>
Expand Down

0 comments on commit 3d500d6

Please sign in to comment.