mirror of
https://github.com/open-webui/open-webui
synced 2025-05-17 12:03:41 +00:00
refac
This commit is contained in:
parent
ffd598c5d7
commit
79a83adc89
@ -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')}
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user