enh: summary tag support

This commit is contained in:
Timothy J. Baek
2024-09-30 12:50:53 +02:00
parent d255251e5f
commit ffd598c5d7
3 changed files with 82 additions and 2 deletions
@@ -8,6 +8,7 @@
import MarkdownInlineTokens from '$lib/components/chat/Messages/Markdown/MarkdownInlineTokens.svelte';
import KatexRenderer from './KatexRenderer.svelte';
import { WEBUI_BASE_URL } from '$lib/constants';
import { stringify } from 'postcss';
export let id: string;
export let tokens: Token[];
@@ -94,6 +95,12 @@
{/each}
</ul>
{/if}
{:else if token.type === 'details'}
<details>
<summary>{token.summary}</summary>
<svelte:self id={`${id}-${tokenIdx}-d`} tokens={marked.lexer(token.text)} />
</details>
{:else if token.type === 'html'}
{@const html = DOMPurify.sanitize(token.text)}
{#if html && html.includes('<video')}