import * as md from './markdown.js'; import { expect, describe, it } from 'vitest'; describe('render', async () => { it('renders inline links', async () => { const markdown = `[a link](https://example.com?foo=bar)`; const html = md.render(markdown); expect(html).toStrictEqual( `

a link

`, ); }); it('renders inline links with titles', async () => { const markdown = `[a link](https://example.com?foo=bar "what title")`; const html = md.render(markdown); expect(html).toStrictEqual( `

a link

`, ); }); it('renders footnote links', async () => { const markdown = ` [a link] [a link]: https://example.com?foo=bar`; const html = md.render(markdown); expect(html).toStrictEqual( `

a link

`, ); }); it('renders footnote links with titles', async () => { const markdown = ` [a link] [a link]: https://example.com?foo=bar "what title"`; const html = md.render(markdown); expect(html).toStrictEqual( `

a link

`, ); }); it('renders links with embedded markup', async () => { const markdown = `[a _link_](https://example.com?foo=bar)`; const html = md.render(markdown); expect(html).toStrictEqual( `

a link

`, ); }); });