Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/modules/markdown/MarkdownPreviewPane.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { readFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";

const here = path.dirname(fileURLToPath(import.meta.url));
const src = readFileSync(path.join(here, "MarkdownPreviewPane.tsx"), "utf8");
const streamdownMatch = src.match(/<Streamdown[\s\S]*?<\/Streamdown>/);
const streamdownJsx = streamdownMatch?.[0] ?? "";

describe("MarkdownPreviewPane Streamdown configuration", () => {
it("renders complete markdown files in static mode", () => {
expect(streamdownJsx).toMatch(/mode="static"/);
});

it("does not run streaming incomplete-markdown repair for files", () => {
expect(streamdownJsx).toMatch(/parseIncompleteMarkdown=\{false\}/);
});
});
2 changes: 2 additions & 0 deletions src/modules/markdown/MarkdownPreviewPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export function MarkdownPreviewPane({ path, visible, onSetView }: Props) {
<Streamdown
className="select-text [&>*:first-child]:mt-0 [&>*:last-child]:mb-0"
components={components}
mode="static"
parseIncompleteMarkdown={false}
>
{status.content}
</Streamdown>
Expand Down
Loading