mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-22 22:59:28 +01:00
refac
This commit is contained in:
@@ -27,7 +27,6 @@ export const replaceTokens = (content, char, user) => {
|
||||
const charToken = /{{char}}/gi;
|
||||
const userToken = /{{user}}/gi;
|
||||
const videoIdToken = /{{VIDEO_FILE_ID_([a-f0-9-]+)}}/gi; // Regex to capture the video ID
|
||||
const htmlIdToken = /{{HTML_FILE_ID_([a-f0-9-]+)}}/gi; // Regex to capture the HTML ID
|
||||
|
||||
// Replace {{char}} if char is provided
|
||||
if (char !== undefined && char !== null) {
|
||||
@@ -45,12 +44,6 @@ export const replaceTokens = (content, char, user) => {
|
||||
return `<video src="${videoUrl}" controls></video>`;
|
||||
});
|
||||
|
||||
// Replace HTML ID tags with corresponding HTML content
|
||||
content = content.replace(htmlIdToken, (match, fileId) => {
|
||||
const htmlUrl = `${WEBUI_BASE_URL}/api/v1/files/${fileId}/content`;
|
||||
return `<iframe src="${htmlUrl}" width="100%" frameborder="0" onload="this.style.height=(this.contentWindow.document.body.scrollHeight+20)+'px';"></iframe>`;
|
||||
});
|
||||
|
||||
return content;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user