mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
feat: # to import doc
This commit is contained in:
@@ -128,6 +128,24 @@ export const findWordIndices = (text) => {
|
||||
return matches;
|
||||
};
|
||||
|
||||
export const removeFirstHashWord = (inputString) => {
|
||||
// Split the string into an array of words
|
||||
const words = inputString.split(' ');
|
||||
|
||||
// Find the index of the first word that starts with #
|
||||
const index = words.findIndex((word) => word.startsWith('#'));
|
||||
|
||||
// Remove the first word with #
|
||||
if (index !== -1) {
|
||||
words.splice(index, 1);
|
||||
}
|
||||
|
||||
// Join the remaining words back into a string
|
||||
const resultString = words.join(' ');
|
||||
|
||||
return resultString;
|
||||
};
|
||||
|
||||
export const calculateSHA256 = async (file) => {
|
||||
// Create a FileReader to read the file asynchronously
|
||||
const reader = new FileReader();
|
||||
|
||||
Reference in New Issue
Block a user