mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-20 15:11:09 +00:00
fix(reasoning): prevent LLM-hallucinated HTML tags from rendering as DOM elements (#2321)
* fix * add test * fix
This commit is contained in:
@@ -28,6 +28,15 @@ export const streamdownPluginsWithWordAnimation = {
|
||||
] as StreamdownProps["rehypePlugins"],
|
||||
};
|
||||
|
||||
// Plugins for reasoning/thinking content — derived from streamdownPlugins but without rehypeRaw,
|
||||
// to prevent LLM-hallucinated HTML tags (e.g. <simd>) from being rendered as DOM elements.
|
||||
export const reasoningPlugins = {
|
||||
remarkPlugins: streamdownPlugins.remarkPlugins,
|
||||
rehypePlugins: streamdownPlugins.rehypePlugins?.filter(
|
||||
(p) => p !== rehypeRaw,
|
||||
) as StreamdownProps["rehypePlugins"],
|
||||
};
|
||||
|
||||
// Plugins for human messages - no autolink to prevent URL bleeding into adjacent text
|
||||
export const humanMessagePlugins = {
|
||||
remarkPlugins: [
|
||||
|
||||
Reference in New Issue
Block a user