mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
fix: source citations user message display issue
This commit is contained in:
parent
4d4ed743ae
commit
3c8f1cf8e5
2 changed files with 43 additions and 38 deletions
|
|
@ -75,12 +75,11 @@
|
||||||
`<sup class="footnote-ref footnote-ref-text">${token.escapedText}</sup>`
|
`<sup class="footnote-ref footnote-ref-text">${token.escapedText}</sup>`
|
||||||
) || ''}
|
) || ''}
|
||||||
{:else if token.type === 'citation'}
|
{:else if token.type === 'citation'}
|
||||||
|
{#if (sourceIds ?? []).length > 0}
|
||||||
<SourceToken {id} {token} {sourceIds} onClick={onSourceClick} />
|
<SourceToken {id} {token} {sourceIds} onClick={onSourceClick} />
|
||||||
<!-- {#if token.ids && token.ids.length > 0}
|
{:else}
|
||||||
{#each token.ids as sourceId}
|
<TextToken {token} {done} />
|
||||||
<Source id={sourceId - 1} title={sourceIds[sourceId - 1]} onClick={onSourceClick} />
|
{/if}
|
||||||
{/each}
|
|
||||||
{/if} -->
|
|
||||||
{:else if token.type === 'text'}
|
{:else if token.type === 'text'}
|
||||||
<TextToken {token} {done} />
|
<TextToken {token} {done} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{sourceIds}
|
||||||
|
|
||||||
|
{#if sourceIds}
|
||||||
{#if (token?.ids ?? []).length == 1}
|
{#if (token?.ids ?? []).length == 1}
|
||||||
<Source id={token.ids[0] - 1} title={sourceIds[token.ids[0] - 1]} {onClick} />
|
<Source id={token.ids[0] - 1} title={sourceIds[token.ids[0] - 1]} {onClick} />
|
||||||
{:else}
|
{:else}
|
||||||
|
|
@ -73,3 +76,6 @@
|
||||||
</LinkPreview.Content>
|
</LinkPreview.Content>
|
||||||
</LinkPreview.Root>
|
</LinkPreview.Root>
|
||||||
{/if}
|
{/if}
|
||||||
|
{:else}
|
||||||
|
<span>{token.raw}</span>
|
||||||
|
{/if}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue