import { trimIndentation } from "../../../spec/support/utils.js"; import markdownService from "./markdown.js"; describe("markdown", () => { it("converts h1 heading", () => { const result = markdownService.renderToHtml(trimIndentation`\ # Hello ## world # another one Hello, world `, "title"); expect(result).toBe(trimIndentation`\

Hello

world

another one

Hello, world

`); }); it("rewrites language of known language tags", () => { const result = markdownService.renderToHtml(trimIndentation`\ \`\`\`javascript Hi \`\`\` \`\`\`css there \`\`\` `, "title"); expect(result).toBe(trimIndentation`\
Hi
there
`); }); it("rewrites language of unknown language tags", () => { const result = markdownService.renderToHtml(trimIndentation`\ \`\`\`unknownlanguage Hi \`\`\` `, "title"); expect(result).toBe(trimIndentation`\
Hi
`); }); });