mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 19:37:47 +01:00
refac/fix: source citation
This commit is contained in:
@@ -70,7 +70,10 @@ export const replaceTokens = (content, sourceIds, char, user) => {
|
||||
if (Array.isArray(sourceIds)) {
|
||||
sourceIds.forEach((sourceId, idx) => {
|
||||
const regex = new RegExp(`\\[${idx + 1}\\]`, 'g');
|
||||
segment = segment.replace(regex, `<source_id data="${idx + 1}" title="${sourceId}" />`);
|
||||
segment = segment.replace(
|
||||
regex,
|
||||
`<source_id data="${idx + 1}" title="${encodeURIComponent(sourceId)}" />`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user