| 1 | import MarkdownExit from 'markdown-exit' |
| 2 | import { expect, it } from 'vitest' |
| 3 | import MarkdownItLink from './link' |
| 4 | |
| 5 | it('links', async () => { |
| 6 | const md = MarkdownExit() |
| 7 | md.use(MarkdownItLink) |
| 8 | |
| 9 | expect(await md.renderAsync('[slide 1](#1)')).toMatchInlineSnapshot(` |
| 10 | "<p><Link to="#1">slide 1</Link></p> |
| 11 | " |
| 12 | `) |
| 13 | |
| 14 | expect(await md.renderAsync('[external](https://example.com)')).toMatchInlineSnapshot(` |
| 15 | "<p><a href="https://example.com" target="_blank">external</a></p> |
| 16 | " |
| 17 | `) |
| 18 | }) |
| 19 |