diff --git a/packages/markdown-core/src/render.capabilities.test.ts b/packages/markdown-core/src/render.capabilities.test.ts deleted file mode 100644 index 1d428b89b9f4..000000000000 --- a/packages/markdown-core/src/render.capabilities.test.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { describe, expect, it } from "vitest"; -import type { FormatCapabilityProfile } from "./format-capabilities.js"; -import { markdownToIR } from "./ir.js"; -import { renderMarkdownWithAttributedRanges } from "./render-attributed.js"; -import { renderMarkdownWithMarkers } from "./render.js"; - -const ALL_NATIVE = { - mechanism: "markdown", - constructs: { - bold: "native", - italic: "native", - underline: "native", - strikethrough: "native", - spoiler: "native", - codeInline: "native", - codeBlock: "native", - codeLanguage: "native", - linkLabel: "native", - heading: "native", - bulletList: "native", - orderedList: "native", - taskList: "native", - table: "native", - blockquote: "native", - image: "native", - mention: "native", - }, - chunk: { limit: 4_000, unit: "chars" }, -} satisfies FormatCapabilityProfile; - -describe("format capability driver plumbing", () => { - const ir = markdownToIR("**See [docs](https://example.com)**", { headingStyle: "rich" }); - - it("keeps marker rendering byte-identical for an all-native optional profile", () => { - const options = { - styleMarkers: { bold: { open: "", close: "" } }, - escapeText: (text: string) => text, - buildLink: (link: { start: number; end: number; href: string }) => ({ - start: link.start, - end: link.end, - open: "", - close: "", - }), - }; - expect(renderMarkdownWithMarkers(ir, options, ALL_NATIVE)).toBe( - renderMarkdownWithMarkers(ir, options), - ); - }); - - it("preserves caller-constructed style spans for an all-native profile", () => { - const customIr = { - text: "same", - styles: [ - { start: 0, end: 2, style: "bold" as const }, - { start: 2, end: 4, style: "bold" as const }, - ], - links: [], - }; - const options = { - styleMarkers: { bold: { open: "*", close: "*" } }, - escapeText: (text: string) => text, - }; - expect(renderMarkdownWithMarkers(customIr, options, ALL_NATIVE)).toBe( - renderMarkdownWithMarkers(customIr, options), - ); - }); - - it("keeps attributed rendering byte-identical for an all-native optional profile", () => { - const options = { styleMap: { bold: "strong" as const }, renderLink: () => " (url)" }; - expect(renderMarkdownWithAttributedRanges(ir, options, ALL_NATIVE)).toEqual( - renderMarkdownWithAttributedRanges(ir, options), - ); - }); -});