feat: new UI for chat file manager is ready

This commit is contained in:
RockYang
2024-06-25 18:59:27 +08:00
parent d63536d5ef
commit f8fed83507
16 changed files with 386 additions and 113 deletions

View File

@@ -223,23 +223,9 @@ export function processContent(content) {
}
export function processPrompt(prompt) {
prompt = prompt.replace(/&/g, "&")
return prompt.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;");
const linkRegex = /(https?:\/\/\S+)/g;
const links = prompt.match(linkRegex);
if (links) {
for (let link of links) {
if (isImage(link)) {
const index = prompt.indexOf(link)
if (prompt.substring(index - 1, 2) !== "]") {
prompt = prompt.replace(link, "\n![](" + link + ")\n")
}
}
}
}
return prompt
}
// 判断是否为微信浏览器
@@ -258,3 +244,4 @@ export function showLoginDialog(router) {
// on cancel
});
}