Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: > Cannot be displayed in the message (#21560)

balibabu5c8fd4d1b630
diff --git a/web/src/components/markdown-content/index.tsx b/web/src/components/markdown-content/index.tsx
index eda6e28193..dfd39cd369 100644
--- a/web/src/components/markdown-content/index.tsx
+++ b/web/src/components/markdown-content/index.tsx
@@ -167,6 +167,8 @@ const MarkdownContent = ({
(value: string) => replaceThinkToSection(value, thinkSummary),
replaceRetrievingToSection,
preprocessLaTeX,
+ // Entity decoding can expose a line-leading > after the first escape.
+ escapeUnmatchedAngleBrackets,
)(nextText),
);
}, [content, loading, t]);
diff --git a/web/src/components/next-markdown-content/index.tsx b/web/src/components/next-markdown-content/index.tsx
index ea5b060748..9e315b9a2b 100644
--- a/web/src/components/next-markdown-content/index.tsx
+++ b/web/src/components/next-markdown-content/index.tsx
@@ -229,6 +229,8 @@ function MarkdownContent({
(value: string) => replaceThinkToSection(value, thinkSummary),
replaceRetrievingToSection,
preprocessLaTeX,
+ // Entity decoding can expose a line-leading > after the first escape.
+ escapeUnmatchedAngleBrackets,
)(nextText),
);
}, [content, loading, t]);
diff --git a/web/src/pages/next-search/markdown-content/index.tsx b/web/src/pages/next-search/markdown-content/index.tsx
index 7c58ef95ca..b8add5c227 100644
--- a/web/src/pages/next-search/markdown-content/index.tsx
+++ b/web/src/pages/next-search/markdown-content/index.tsx
@@ -104,6 +104,8 @@ const MarkdownContent = ({
replaceThinkToSection,
replaceRetrievingToSection,
preprocessLaTeX,
+ // Entity decoding can expose a line-leading > after the first escape.
+ escapeUnmatchedAngleBrackets,
)(nextText),
);
}, [content, t]);
diff --git a/web/src/pages/user-setting/compilation-templates/edit-next/utils.test.ts b/web/src/pages/user-setting/compilation-templates/edit-next/utils.test.ts
new file mode 100644
index 0000000000..fd50f353f3
--- /dev/null
+++ b/web/src/pages/user-setting/compilation-templates/edit-next/utils.test.ts
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { sortSectionNames } from './utils';
+
+describe('sortSectionNames', () => {
+ it('prioritizes known sections and preserves remaining order and duplicates', () => {
+ expect(
+ sortSectionNames([
+ 'claim',
+ 'relation',
+ 'claim',
+ 'entity',
+ 'concept',
+ 'claim',
+ ]),
+ ).toEqual(['entity', 'relation', 'claim', 'claim', 'concept', 'claim']);
+ });
+});