import { describe, expect, it } from 'vitest' import { renderMarkdown } from '../src/renderer/src/markdown' describe('renderMarkdown', () => { it('renders headings, bold, italic and links', () => { const html = renderMarkdown('# Title\n\nSome **bold** and *italic* and [a](https://x.com).') expect(html).toContain('

Title

') expect(html).toContain('bold') expect(html).toContain('italic') expect(html).toContain('a') }) it('restores code spans without colliding with surrounding digits', () => { // " 0 " around the text used to clash with the placeholder index — guard it. const html = renderMarkdown('I have 0 cats and `code` and 1 dog.') expect(html).toContain('code') expect(html).toContain('I have 0 cats') expect(html).toContain('1 dog.') expect(html).not.toContain('undefined') }) it('escapes HTML and never passes through raw tags', () => { const html = renderMarkdown('A tag.') expect(html).toContain('<script>') expect(html).not.toContain('