RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix: Answers with links to information not parsing #3839 (#3968)
balibabue0533f19e942
diff --git a/web/reducer.js b/web/reducer.jsdeleted file mode 100644index 5a8d5cc6fb..0000000000--- a/web/reducer.js+++ /dev/null@@ -1,26 +0,0 @@-import React, { useReducer } from 'react';-const CHANGE_LOCALE = 'CHANGE_LOCALE';--const mainContext = React.createContext();--const reducer = (state, action) => {- switch (action.type) {- case CHANGE_LOCALE:- return { ...state, locale: action.locale || 'zh' };- default:- return state;- }-};--const ContextProvider = (props) => {- const [state, dispatch] = useReducer(reducer, {- locale: 'zh',- });- return (- <mainContext.Provider value={{ state, dispatch }}>- {props.children}- </mainContext.Provider>- );-};--export { ContextProvider, mainContext, reducer };diff --git a/web/src/pages/chat/markdown-content/index.tsx b/web/src/pages/chat/markdown-content/index.tsxindex 5e0d30c209..d4acf95e67 100644--- a/web/src/pages/chat/markdown-content/index.tsx+++ b/web/src/pages/chat/markdown-content/index.tsx@@ -20,9 +20,10 @@ import { useTranslation } from 'react-i18next';import 'katex/dist/katex.min.css'; // `rehype-katex` does not import the CSS for you+import { replaceTextByOldReg } from '../utils';import styles from './index.less';-const reg = /(#{2}\d+\${2})/g;+const reg = /(#{2}\d+@{2})/g;const curReg = /(~{2}\d+\${2})/g;const getChunkIndex = (match: string) => Number(match.slice(2, -2));@@ -156,7 +157,9 @@ const MarkdownContent = ({const renderReference = useCallback((text: string) => {- let replacedText = reactStringReplace(text, reg, (match, i) => {+ const nextText = replaceTextByOldReg(text);++ let replacedText = reactStringReplace(nextText, reg, (match, i) => {const chunkIndex = getChunkIndex(match);return (<Popover content={getPopoverContent(chunkIndex)} key={i}>diff --git a/web/src/pages/chat/utils.ts b/web/src/pages/chat/utils.tsindex 820bd2ca58..3c8bef7066 100644--- a/web/src/pages/chat/utils.ts+++ b/web/src/pages/chat/utils.ts@@ -41,3 +41,11 @@ export const buildMessageItemReference = (return reference ?? { doc_aggs: [], chunks: [], total: 0 };};++const oldReg = /(#{2}\d+\${2})/g;++export const replaceTextByOldReg = (text: string) => {+ return text.replace(oldReg, function (substring) {+ return `${substring.slice(0, -2)}@@`;+ });+};