enh: inline citations

This commit is contained in:
Timothy Jaeryang Baek
2024-11-21 17:58:29 -08:00
parent 5be7cbfdf5
commit 386c976e9a
11 changed files with 102 additions and 22 deletions
@@ -12,9 +12,11 @@
import Image from '$lib/components/common/Image.svelte';
import KatexRenderer from './KatexRenderer.svelte';
import Source from './Source.svelte';
export let id: string;
export let tokens: Token[];
export let onSourceClick: Function = () => {};
</script>
{#each tokens as token}
@@ -26,6 +28,8 @@
{@html html}
{:else if token.text.includes(`<iframe src="${WEBUI_BASE_URL}/api/v1/files/`)}
{@html `${token.text}`}
{:else if token.text.includes(`<source_id`)}
<Source {token} onClick={onSourceClick} />
{:else}
{token.text}
{/if}