import markdownExportService from "../../../src/services/export/md.js"; import { trimIndentation } from "../../support/utils.js"; describe("Markdown export", () => { it("trims language tag for code blocks", () => { const html = trimIndentation`\
A diff:
Hello
-world
+worldy
`;
const expected = trimIndentation`\
A diff:
\`\`\`diff
Hello
-world
+worldy
\`\`\``;
expect(markdownExportService.toMarkdown(html)).toBe(expected);
});
it("removes auto tag for code blocks", () => {
const html = trimIndentation`\
Hello
-world
+worldy
`;
const expected = trimIndentation`\
\`\`\`
Hello
-world
+worldy
\`\`\``;
expect(markdownExportService.toMarkdown(html)).toBe(expected);
})
});