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
@@ -0,0 +1,13 @@
import rehypeRaw from "rehype-raw";
import { expect, test } from "vitest";
import { reasoningPlugins, streamdownPlugins } from "@/core/streamdown/plugins";
test("streamdownPlugins includes rehypeRaw", () => {
expect(streamdownPlugins.rehypePlugins).toContain(rehypeRaw);
});
test("reasoningPlugins does not include rehypeRaw", () => {
const flat = reasoningPlugins.rehypePlugins?.flat();
expect(flat).not.toContain(rehypeRaw);
});