mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-05 23:10:22 +08:00
For human messages, disable remark-gfm autolink feature to prevent URLs from incorrectly including adjacent text (especially Chinese characters) as part of the link. This ensures that when users input "https://example.com 帮我分析", only the URL becomes a link. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
885 B
TypeScript
27 lines
885 B
TypeScript
import rehypeKatex from "rehype-katex";
|
|
import remarkGfm from "remark-gfm";
|
|
import remarkMath from "remark-math";
|
|
import type { StreamdownProps } from "streamdown";
|
|
|
|
export const streamdownPlugins = {
|
|
remarkPlugins: [
|
|
remarkGfm,
|
|
[remarkMath, { singleDollarTextMath: true }],
|
|
] as StreamdownProps["remarkPlugins"],
|
|
rehypePlugins: [
|
|
[rehypeKatex, { output: "html" }],
|
|
] as StreamdownProps["rehypePlugins"],
|
|
};
|
|
|
|
// Plugins for human messages - no autolink to prevent URL bleeding into adjacent text
|
|
export const humanMessagePlugins = {
|
|
remarkPlugins: [
|
|
// Use remark-gfm without autolink literals by not including it
|
|
// Only include math support for human messages
|
|
[remarkMath, { singleDollarTextMath: true }],
|
|
] as StreamdownProps["remarkPlugins"],
|
|
rehypePlugins: [
|
|
[rehypeKatex, { output: "html" }],
|
|
] as StreamdownProps["rehypePlugins"],
|
|
};
|