mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: HTML_FILE_ID handling
This commit is contained in:
@@ -41,8 +41,7 @@ export const replaceTokens = (content, sourceIds, char, user) => {
|
||||
},
|
||||
{
|
||||
regex: /{{HTML_FILE_ID_([a-f0-9-]+)}}/gi,
|
||||
replacement: (_, fileId) =>
|
||||
`<iframe src="${WEBUI_BASE_URL}/api/v1/files/${fileId}/content/html" width="100%" frameborder="0" onload="this.style.height=(this.contentWindow.document.body.scrollHeight+20)+'px';"></iframe>`
|
||||
replacement: (_, fileId) => `<file type="html" id="${fileId}" />`
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user