fix(reasoning): prevent LLM-hallucinated HTML tags from rendering as DOM elements (#2321)

* fix

* add test

* fix
This commit is contained in:
Xun
2026-04-19 19:27:34 +08:00
committed by GitHub
parent 80e210f5bb
commit 7c87dc5bca
3 changed files with 24 additions and 1 deletions
@@ -11,6 +11,7 @@ import { BrainIcon, ChevronDownIcon } from "lucide-react";
import type { ComponentProps, ReactNode } from "react";
import { createContext, memo, useContext, useEffect, useState } from "react";
import { Streamdown } from "streamdown";
import { reasoningPlugins } from "@/core/streamdown/plugins";
import { Shimmer } from "./shimmer";
type ReasoningContextValue = {
@@ -177,7 +178,7 @@ export const ReasoningContent = memo(
)}
{...props}
>
<Streamdown {...props}>{children}</Streamdown>
<Streamdown {...reasoningPlugins}>{children}</Streamdown>
</CollapsibleContent>
),
);