Download frontend/src/core/streamdown/plugins.ts from yonagush/deerflow: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/yonagush/deerflow/resolve/main/frontend/src/core/streamdown/plugins.ts
- Command line
-
hf download hf://spaces/yonagush/deerflow/frontend/src/core/streamdown/plugins.ts
-
curl -L -o plugins.ts https://huggingface.co/spaces/yonagush/deerflow/resolve/main/frontend/src/core/streamdown/plugins.ts
1.3 kB
| import rehypeKatex from "rehype-katex"; | |
| import rehypeRaw from "rehype-raw"; | |
| import remarkGfm from "remark-gfm"; | |
| import remarkMath from "remark-math"; | |
| import type { StreamdownProps } from "streamdown"; | |
| import { rehypeSplitWordsIntoSpans } from "../rehype"; | |
| export const streamdownPlugins = { | |
| remarkPlugins: [ | |
| remarkGfm, | |
| [remarkMath, { singleDollarTextMath: true }], | |
| ] as StreamdownProps["remarkPlugins"], | |
| rehypePlugins: [ | |
| rehypeRaw, | |
| [rehypeKatex, { output: "html" }], | |
| ] as StreamdownProps["rehypePlugins"], | |
| }; | |
| export const streamdownPluginsWithWordAnimation = { | |
| remarkPlugins: [ | |
| remarkGfm, | |
| [remarkMath, { singleDollarTextMath: true }], | |
| ] as StreamdownProps["remarkPlugins"], | |
| rehypePlugins: [ | |
| [rehypeKatex, { output: "html" }], | |
| rehypeSplitWordsIntoSpans, | |
| ] 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"], | |
| }; | |