This commit is contained in:
Timothy J. Baek 2024-09-30 13:03:47 +02:00
parent ffd598c5d7
commit 79a83adc89
2 changed files with 8 additions and 7 deletions

View File

@ -9,6 +9,7 @@
import KatexRenderer from './KatexRenderer.svelte'; import KatexRenderer from './KatexRenderer.svelte';
import { WEBUI_BASE_URL } from '$lib/constants'; import { WEBUI_BASE_URL } from '$lib/constants';
import { stringify } from 'postcss'; import { stringify } from 'postcss';
import Collapsible from '$lib/components/common/Collapsible.svelte';
export let id: string; export let id: string;
export let tokens: Token[]; export let tokens: Token[];
@ -96,11 +97,11 @@
</ul> </ul>
{/if} {/if}
{:else if token.type === 'details'} {:else if token.type === 'details'}
<details> <Collapsible title={token.summary} className="w-fit space-y-1">
<summary>{token.summary}</summary> <div class=" mb-1.5" slot="content">
<svelte:self id={`${id}-${tokenIdx}-d`} tokens={marked.lexer(token.text)} /> <svelte:self id={`${id}-${tokenIdx}-d`} tokens={marked.lexer(token.text)} />
</details> </div>
</Collapsible>
{:else if token.type === 'html'} {:else if token.type === 'html'}
{@const html = DOMPurify.sanitize(token.text)} {@const html = DOMPurify.sanitize(token.text)}
{#if html && html.includes('<video')} {#if html && html.includes('<video')}

View File

@ -12,8 +12,8 @@
<div class={className}> <div class={className}>
{#if title !== null} {#if title !== null}
<button class="w-full" on:click={() => (open = !open)}> <button class="w-fit" on:click={() => (open = !open)}>
<div class=" w-full font-medium transition flex items-center justify-between gap-2"> <div class=" w-fit font-medium transition flex items-center justify-between gap-2">
<div> <div>
{title} {title}
</div> </div>