mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
enh: allow iframe in content
This commit is contained in:
parent
72df23ed79
commit
b082a7edbe
1 changed files with 15 additions and 0 deletions
|
|
@ -69,6 +69,21 @@
|
|||
>
|
||||
</iframe>
|
||||
{/if}
|
||||
{:else if token.text && token.text.includes('<iframe')}
|
||||
{@const match = token.text.match(/<iframe\s+[^>]*src="([^"]+)"[^>]*><\/iframe>/)}
|
||||
{@const iframeSrc = match && match[1]}
|
||||
{#if iframeSrc}
|
||||
<iframe
|
||||
class="w-full my-2"
|
||||
src={iframeSrc}
|
||||
title="Embedded content"
|
||||
frameborder="0"
|
||||
sandbox
|
||||
onload="this.style.height=(this.contentWindow.document.body.scrollHeight+20)+'px';"
|
||||
></iframe>
|
||||
{:else}
|
||||
{token.text}
|
||||
{/if}
|
||||
{:else if token.text.includes(`<file type="html"`)}
|
||||
{@const match = token.text.match(/<file type="html" id="([^"]+)"/)}
|
||||
{@const fileId = match && match[1]}
|
||||
|
|
|
|||
Loading…
Reference in a new issue